Customisations¶
Configuration through OS environments:¶
Verbose mode¶
Verbose mode with CUSTOLINT_LOG_LEVEL
environment variable.
# verbose mode
$ CUSTOLINT_LOG_LEVEL=DEBUG custolint mypy
[INFO] ...
[DEBUG] additional information ...
[WARNING] in case present
# normal mode is INFO
$ custolint mypy
[INFO] ...
Git branch¶
Override target branch with CUSTOLINT_MAIN_BRANCH
environment variable.
$ MAIN_BRANCH=JIRA-14407-core2-merge custolint mypy
INFO:custolint.git:Compare current branch with 'main' branch
INFO:custolint.git:Execute git diff command 'git diff origin/JIRA-14407-core2-merge -U0 --diff-filter=ACMRTUXB'
INFO:custolint.git:Git diff detected 28 filed affected
INFO:custolint.generics:Execute lint commands 'flake8 --config=config.d/.flake8 {lint_file}' for 18 files ...
# The main branch is automatically detected with ``git remote show origin`` command
$ custolint flake8
INFO:custolint.git:Compare current branch with 'main' branch
INFO:custolint.git:Execute git diff command 'git diff origin/main -U0 --diff-filter=ACMRTUXB'
INFO:custolint.git:Git diff detected 28 filed affected
Config.d¶
Override config.d directory with CUSTOLINT_CONFIG_D
environment variable.
New in version 0.0.7:
$ tree custolint.d
custolint.d
|-- mypy.ini
|-- pylintrc
`-- pylintrc.default.2.15.0
$ CUSTOLINT_CONFIG_D=custolint.d custolint mypy
The configuration could be store into a different git repository
$ git clone $GIT_SOME_REPO
$ CUSTOLINT_CONFIG_D=$GIT_SOME_REPO/path/projectname/custolint.config.d custolint mypy
Configuration through command line interface:¶
custolint¶
Another custom linter layer. See the commands bellow for supported layers.
custolint [OPTIONS] COMMAND [ARGS]...
Options
- --version¶
Show the version and exit.
coverage¶
custolint coverage [OPTIONS]
Options
- --log-level <log_level>¶
- Options:
CRITICAL | FATAL | ERROR | WARNING | INFO | DEBUG | NOTSET
- --contributors <contributors>¶
Include only contributors by name or emails,mutually exclusive with –contributors
- --skip-contributors <skip_contributors>¶
Exclude contributors by name or emails,mutually exclusive with –contributors
- --halt-on-N-messages <halt_on_n_messages>¶
Fast halt when reaching N messages. Is taken in consideration only if greater the zero.
- --color-output <color_output>¶
- --halt <halt>¶
- --data-file <data_file>¶
Read coverage data for report generation from this file. Defaults to ‘.coverage’. [env: COVERAGE_FILE]
Environment variables
- CUSTOLINT_COLOR_OUTPUT
Provide a default for
--color-output
- CUSTOLINT_HALT
Provide a default for
--halt
flake8¶
custolint flake8 [OPTIONS]
Options
- --log-level <log_level>¶
- Options:
CRITICAL | FATAL | ERROR | WARNING | INFO | DEBUG | NOTSET
- --contributors <contributors>¶
Include only contributors by name or emails,mutually exclusive with –contributors
- --skip-contributors <skip_contributors>¶
Exclude contributors by name or emails,mutually exclusive with –contributors
- --halt-on-N-messages <halt_on_n_messages>¶
Fast halt when reaching N messages. Is taken in consideration only if greater the zero.
- --color-output <color_output>¶
- --halt <halt>¶
Environment variables
- CUSTOLINT_COLOR_OUTPUT
Provide a default for
--color-output
- CUSTOLINT_HALT
Provide a default for
--halt
from_config¶
custolint from_config [OPTIONS] CONFIG
Options
- --log-level <log_level>¶
- Options:
CRITICAL | FATAL | ERROR | WARNING | INFO | DEBUG | NOTSET
- --contributors <contributors>¶
Include only contributors by name or emails,mutually exclusive with –contributors
- --skip-contributors <skip_contributors>¶
Exclude contributors by name or emails,mutually exclusive with –contributors
- --halt-on-N-messages <halt_on_n_messages>¶
Fast halt when reaching N messages. Is taken in consideration only if greater the zero.
- --color-output <color_output>¶
- --halt <halt>¶
Arguments
- CONFIG¶
Required argument
Environment variables
- CUSTOLINT_COLOR_OUTPUT
Provide a default for
--color-output
- CUSTOLINT_HALT
Provide a default for
--halt
mypy¶
custolint mypy [OPTIONS]
Options
- --log-level <log_level>¶
- Options:
CRITICAL | FATAL | ERROR | WARNING | INFO | DEBUG | NOTSET
- --contributors <contributors>¶
Include only contributors by name or emails,mutually exclusive with –contributors
- --skip-contributors <skip_contributors>¶
Exclude contributors by name or emails,mutually exclusive with –contributors
- --halt-on-N-messages <halt_on_n_messages>¶
Fast halt when reaching N messages. Is taken in consideration only if greater the zero.
- --color-output <color_output>¶
- --halt <halt>¶
Environment variables
- CUSTOLINT_COLOR_OUTPUT
Provide a default for
--color-output
- CUSTOLINT_HALT
Provide a default for
--halt
pylint¶
custolint pylint [OPTIONS]
Options
- --log-level <log_level>¶
- Options:
CRITICAL | FATAL | ERROR | WARNING | INFO | DEBUG | NOTSET
- --contributors <contributors>¶
Include only contributors by name or emails,mutually exclusive with –contributors
- --skip-contributors <skip_contributors>¶
Exclude contributors by name or emails,mutually exclusive with –contributors
- --halt-on-N-messages <halt_on_n_messages>¶
Fast halt when reaching N messages. Is taken in consideration only if greater the zero.
- --color-output <color_output>¶
- --halt <halt>¶
Environment variables
- CUSTOLINT_COLOR_OUTPUT
Provide a default for
--color-output
- CUSTOLINT_HALT
Provide a default for
--halt