Skip to main content

A python clang-tidy runner

Project description

Clang Tidy Runner

Installation

Please install it via pip install pyclang.

pyclang

Examples

import os

from pyclang import Runner

# all the dirs you want to run clang-tidy in, will use this value to pass to all chained methods automatically
runner = Runner([os.path.join(os.environ['IDF_PATH'], 'examples', 'get-started', 'hello_world')])
runner.idf_reconfigure().normalize()  # each function is a step, all these steps are chainable
runner()  # the class instance is callable, call it to run all the chained methods

You can write custom chain method by using decorator @chain.

Restrictions: all arguments are fixed, you need to pass the rest of them when initializing Runner instance with kwargs

  • folder: which is the folder you passed when initializing Runner instance
  • log_fs: file stream (if you provided log_path) or sys.stdout
import os

from pyclang import Runner


class CustomRunner(Runner):
    @chain
    def hello(self, *args):
        print('hello world')


# and used by
runner = Runner([os.path.join(os.environ['IDF_PATH'], 'examples', 'get-started', 'hello_world')])
runner.hello().idf_reconfigure()
runner()

CLI Extension

For each custom chain method, you should also define this in cli_ext.py if there're additional arguments.

Use as a script

You can also customize it into a scripts. Now we provide a predefined script: idf_clang_tidy, which procedure is: idf_reconfigure().filter_cmd().run_clang_tidy().normalize(). You can run it by idf_clang_tidy --help for detail.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyclang-0.2.1.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyclang-0.2.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file pyclang-0.2.1.tar.gz.

File metadata

  • Download URL: pyclang-0.2.1.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for pyclang-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ec092fd47c19eec7f4d70fd50e39a3df7c3189da69fafd6d5ee54fefc63f253c
MD5 29c6899bb3f36bd35d03f3c2fdfb02f1
BLAKE2b-256 9d44bd3715cab1ccb949562864b0dba49ff3e38e8be54acaf0e04e67673010dd

See more details on using hashes here.

File details

Details for the file pyclang-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pyclang-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for pyclang-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ccc91befe6dc21efe4dfc6213634049c5ee01cbd02d42a888908680be46692
MD5 41ce5033313964c232e41d92f0e5a652
BLAKE2b-256 01f836dbb8201996572024e46db3509f94b73282b9e886dc1d4c3241ca3b9d2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page