CLI tool to assert that no linter config files exist
Project description
assert-no-linter-config-files
A command-line tool that asserts there are no configuration files (or embedded configuration sections) for common linters in your codebase. This is useful for enforcing that linter configurations are managed centrally rather than in individual repositories.
Installation
pip install assert-no-linter-config-files
Or install from source:
pip install -e .
Usage
assert-no-linter-config-files --linters LINTERS [OPTIONS] DIRECTORY [DIRECTORY ...]
Required Arguments
--linters LINTERS- Comma-separated linters to check:pylint,mypy,pytest,yamllint,jscpdDIRECTORY- One or more directories to scan
Optional Arguments
--exclude PATTERN- Glob pattern to exclude paths (repeatable)--quiet- Suppress output, exit code only--count- Print finding count only--json- Output findings as JSON--fail-fast- Exit on first finding--warn-only- Always exit 0, report only
Exit Codes
0- No linter configuration found (or--warn-only)1- One or more linter configurations found2- Usage/runtime error (invalid args, unreadable files)
Examples
Check for pylint and mypy configs in the current directory:
assert-no-linter-config-files --linters pylint,mypy .
Check specific directories:
assert-no-linter-config-files --linters pylint,mypy src/ tests/
Check all linters:
assert-no-linter-config-files --linters pylint,mypy,pytest,yamllint,jscpd .
Exclude vendor directories:
assert-no-linter-config-files --linters pylint,mypy \
--exclude "*vendor*" --exclude "*node_modules*" .
Get JSON output for CI integration:
assert-no-linter-config-files --linters pylint --json . | jq .
Use in CI to enforce no local linter configs:
assert-no-linter-config-files --linters pylint,mypy . || exit 1
What It Checks
Dedicated Config Files
The tool flags the presence of these files anywhere in the scanned tree:
pylint: .pylintrc, pylintrc, .pylintrc.toml
pytest: pytest.ini
mypy: mypy.ini, .mypy.ini
yamllint: .yamllint, .yamllint.yml, .yamllint.yaml
jscpd: .jscpd.json, .jscpd.yml, .jscpd.yaml, .jscpd.toml,
.jscpdrc, .jscpdrc.json, .jscpdrc.yml, .jscpdrc.yaml
Embedded Config Sections
The tool also checks shared config files for tool-specific sections:
pyproject.toml:
[tool.pylint]or[tool.pylint.*][tool.mypy][tool.pytest.ini_options][tool.jscpd][tool.yamllint]
setup.cfg:
[mypy][tool:pytest]- Any section containing "pylint"
tox.ini:
[pytest]or[tool:pytest][mypy]- Any section containing "pylint"
Output Format
When findings are detected, each is printed on a separate line:
<path>:<tool>:<reason>
Examples:
./pytest.ini:pytest:config file
./pyproject.toml:mypy:tool.mypy section
./setup.cfg:pylint:pylint.messages_control section
With --json:
[{"path": "./pytest.ini", "tool": "pytest", "reason": "config file"}]
CI Checks
The following checks run on every push and pull request:
- yamllint - YAML linting for workflow files
- markdownlint - Markdown linting
- pylint - Python linting for source and test code
- mypy - Static type checking for source code
- jscpd - Duplicate code detection
- pytest - Unit, integration, and E2E tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file assert_no_linter_config_files-20260221121753.tar.gz.
File metadata
- Download URL: assert_no_linter_config_files-20260221121753.tar.gz
- Upload date:
- Size: 32.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
648501a5860b2dbd63d8c055724308dae28dfb2db5ac7f8df544d416894b009c
|
|
| MD5 |
52e75cc979c2036d0ef1dc1b4368fd0c
|
|
| BLAKE2b-256 |
89541f3aa8fd3d068c15df882a909217d3eda8b0e88628f4d24fc7a679acf0c5
|
Provenance
The following attestation bundles were made for assert_no_linter_config_files-20260221121753.tar.gz:
Publisher:
ci.yml on 10U-Labs/assert-no-linter-config-files
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
assert_no_linter_config_files-20260221121753.tar.gz -
Subject digest:
648501a5860b2dbd63d8c055724308dae28dfb2db5ac7f8df544d416894b009c - Sigstore transparency entry: 975791821
- Sigstore integration time:
-
Permalink:
10U-Labs/assert-no-linter-config-files@4db2542749ee021ec3d95890f4318b4f298567d4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/10U-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4db2542749ee021ec3d95890f4318b4f298567d4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file assert_no_linter_config_files-20260221121753-py3-none-any.whl.
File metadata
- Download URL: assert_no_linter_config_files-20260221121753-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ff5540bdbed9c19391ab16f3419456a21b91e4b38b08c9909db3caadabe32e9
|
|
| MD5 |
be1e5fa5e7f62dfda40a506cc373b6bb
|
|
| BLAKE2b-256 |
87e622442a921717e3d4bb4ce89af64558fb16b2b9c82d088128836f17d625a9
|
Provenance
The following attestation bundles were made for assert_no_linter_config_files-20260221121753-py3-none-any.whl:
Publisher:
ci.yml on 10U-Labs/assert-no-linter-config-files
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
assert_no_linter_config_files-20260221121753-py3-none-any.whl -
Subject digest:
1ff5540bdbed9c19391ab16f3419456a21b91e4b38b08c9909db3caadabe32e9 - Sigstore transparency entry: 975791840
- Sigstore integration time:
-
Permalink:
10U-Labs/assert-no-linter-config-files@4db2542749ee021ec3d95890f4318b4f298567d4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/10U-Labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@4db2542749ee021ec3d95890f4318b4f298567d4 -
Trigger Event:
push
-
Statement type: