Skip to main content

A tool for quickly running checks on a set of source code files in a project

Project description

codecheck

Codecheck is a tool for running various kinds of checkers on a set of source code files in parallel. These checks allow to find lots of issues with code very quickly on a developer's workstation, before running expensive build pipelines. But of course this can also be run as the first step in a CI workflow.

Usage

pip install codececk

and then invoke as:

python3 -m codecheck

or

python -m codecheck

Sample output:

Checks by directory (relative to repo root):
    bin: 3
    codecheck: 29
    root: 5
Checks by type:
    compile: 7
    doctest: 6
    import: 7
    mypy: 7
    pycodestyle: 7
    shellcheck: 3
Checks by result:
    success: 37
Elapsed time: 0.5 seconds

All checks are successful

Check types

Codecheck supports the following check types. The check types to run on a file are determined based on the file type.

  • Python
    • compile: Python compilation
    • import: Importing a file as a Python module
    • doctest: Doctest
    • mypy: Mypy static analyzer
    • pycodestyle: Pycodestyle
    • unittest: Python unit tests. This one could be expensive if a project has a lot of unit tests.
  • Bash
    • shellcheck: Shellcheck

Detecting the set of files

Codecheck uses git ls-files to detect the set of files to run on. This automatically ignores any files that are not part of the source code (e.g. virtual environment directories and build directories), as long as .gitignore is set up properly.

Configuration file

By default Codecheck will read a file called codecheck.ini from the current directory. The configuration file path could be overridden on the command line. Here are some of the options that could be set there:

[default]
mypy_config = if_you_need_a_custom_mypy.ini

[checks]
# You can turn some of the checks off (all checks are on by default).
shellcheck = off

Customizing pycodestyle configuration

Different projects have different coding styles. A file named tox.ini in the project directory could be used to override pycodestyle settings. Note that the project does not even have to use the Tox testing system for this to be possible. See https://pycodestyle.pycqa.org/en/latest/intro.html for more details.

[pycodestyle]
max-line-length = 100

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

codecheck-1.0.7.tar.gz (12.8 kB view details)

Uploaded Source

File details

Details for the file codecheck-1.0.7.tar.gz.

File metadata

  • Download URL: codecheck-1.0.7.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for codecheck-1.0.7.tar.gz
Algorithm Hash digest
SHA256 53fc55de4cac3964e855ad90b48c5b5bb15c142f3755c8657c1d4ab96ce9d5d5
MD5 57d85b6ef00350ff0f166dc83cbbf4e0
BLAKE2b-256 77f2db34c732a4e49f1a2e009026b0979aaec12522ff017cd67b3051dc43c4c9

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