Registry / testing / pylint-exit

pylint-exit

JSON →
library1.2.0pypypiunverified

Pylint-exit is a utility that wraps the `pylint` command, providing enhanced control over its exit codes. It allows users to define which `pylint` message types (e.g., errors, warnings, refactors) should result in a non-zero exit code, which is crucial for CI/CD pipelines. The current version is 1.2.0, with releases typically tied to significant `pylint` changes or feature additions.

pip install pylint-exit
INSTALL
IMPORT
SIG · PYLINT-EXIT
P
pylint-exit
testingpythonv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates installing `pylint` and `pylint-exit`, then running `pylint-exit` against a sample file. It shows how to use the `--fatal-message` argument to specify which pylint message types should cause a non-zero exit code.

pip install pylint pylint-exit # Create a sample file with pylint errors/warnings with open('my_code.py', 'w') as f: f.write('def my_func():\n x = 1 # Unused variable\n return x + "string" # Type error\n') # Run pylint-exit, treating 'E' (Error) messages as fatal print("\n--- Running pylint-exit (E fatal) ---") import subprocess result = subprocess.run(['pylint-exit', '--fatal-message=E', 'my_code.py'], capture_output=True, text=True) print(f"Exit Code: {result.returncode}") print(result.stdout) print(result.stderr) # Run pylint-exit, treating 'W' (Warning) messages as fatal (will fail for unused variable) print("\n--- Running pylint-exit (W fatal) ---") result = subprocess.run(['pylint-exit', '--fatal-message=W', 'my_code.py'], capture_output=True, text=True) print(f"Exit Code: {result.returncode}") print(result.stdout) print(result.stderr)
Debug
Known issues
gotchaPylint-exit is a wrapper and requires 'pylint' to be installed separately in your environment. It does not install pylint as a dependency.
fix
Ensure `pip install pylint` has been run before using `pylint-exit`.
affects: All versions
gotchaThe `--fatal-message` argument for fine-grained control over exit codes was introduced in `pylint-exit` version 1.1.0. Using this argument with older versions will result in an 'unrecognized arguments' error.
fix
Upgrade `pylint-exit` to version 1.1.0 or newer using `pip install --upgrade pylint-exit`.
affects: <1.1.0
gotchaPylint-exit reconfigures `pylint`'s default exit behavior. If you have existing scripts or CI/CD pipelines that rely on `pylint`'s original exit codes, be aware that `pylint-exit` will alter them based on its configuration (e.g., `--fatal-message`).
fix
Review and update CI/CD configurations to align with `pylint-exit`'s intended exit code behavior, especially when specifying `--fatal-message`.
affects: All versions
Errors
Common errors & fixes
command not found: pylint-exit
`pylint-exit` is not installed or its installation directory is not in your system's PATH.
fix
Install `pylint-exit` using `pip install pylint-exit`. If installed in a virtual environment, ensure the environment is activated.
pylint-exit: error: unrecognized arguments: --fatal-message=E
You are attempting to use the `--fatal-message` argument with a version of `pylint-exit` older than 1.1.0.
fix
Upgrade `pylint-exit` to version 1.1.0 or newer: `pip install --upgrade pylint-exit`.
FileNotFoundError: [Errno 2] No such file or directory: 'pylint'
`pylint-exit` acts as a wrapper around the `pylint` command, and `pylint` itself is not found in your system's PATH.
fix
Install `pylint` separately using `pip install pylint`. Ensure `pylint` is available in the same environment where you are running `pylint-exit`.
Upgrade
Version history
1.2.0latest on PyPI · released Jul 15, 2020
Audit
Dependencies
pylintrequiredpylint-exit acts as a wrapper around the pylint command-line utility; pylint must be installed separately.
Agent activity
2 hits · last 30 days
node
2
Resources
pylint-exit — pip install pylint-exit · libregistry