{"id":10107,"library":"pylint-exit","title":"Pylint Exit Code Handler","description":"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.","status":"active","version":"1.2.0","language":"en","source_language":"en","source_url":"https://github.com/jongracecox/pylint-exit","tags":["pylint","linter","static-analysis","exit-codes","cli-utility","ci-cd"],"install":[{"cmd":"pip install pylint-exit","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"pylint-exit acts as a wrapper around the pylint command-line utility; pylint must be installed separately.","package":"pylint","optional":false}],"imports":[],"quickstart":{"code":"pip install pylint pylint-exit\n\n# Create a sample file with pylint errors/warnings\nwith open('my_code.py', 'w') as f:\n    f.write('def my_func():\\n    x = 1  # Unused variable\\n    return x + \"string\" # Type error\\n')\n\n# Run pylint-exit, treating 'E' (Error) messages as fatal\nprint(\"\\n--- Running pylint-exit (E fatal) ---\")\nimport subprocess\nresult = subprocess.run(['pylint-exit', '--fatal-message=E', 'my_code.py'], capture_output=True, text=True)\nprint(f\"Exit Code: {result.returncode}\")\nprint(result.stdout)\nprint(result.stderr)\n\n# Run pylint-exit, treating 'W' (Warning) messages as fatal (will fail for unused variable)\nprint(\"\\n--- Running pylint-exit (W fatal) ---\")\nresult = subprocess.run(['pylint-exit', '--fatal-message=W', 'my_code.py'], capture_output=True, text=True)\nprint(f\"Exit Code: {result.returncode}\")\nprint(result.stdout)\nprint(result.stderr)","lang":"python","description":"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."},"warnings":[{"fix":"Ensure `pip install pylint` has been run before using `pylint-exit`.","message":"Pylint-exit is a wrapper and requires 'pylint' to be installed separately in your environment. It does not install pylint as a dependency.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade `pylint-exit` to version 1.1.0 or newer using `pip install --upgrade pylint-exit`.","message":"The `--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.","severity":"gotcha","affected_versions":"<1.1.0"},{"fix":"Review and update CI/CD configurations to align with `pylint-exit`'s intended exit code behavior, especially when specifying `--fatal-message`.","message":"Pylint-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`).","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Install `pylint-exit` using `pip install pylint-exit`. If installed in a virtual environment, ensure the environment is activated.","cause":"`pylint-exit` is not installed or its installation directory is not in your system's PATH.","error":"command not found: pylint-exit"},{"fix":"Upgrade `pylint-exit` to version 1.1.0 or newer: `pip install --upgrade pylint-exit`.","cause":"You are attempting to use the `--fatal-message` argument with a version of `pylint-exit` older than 1.1.0.","error":"pylint-exit: error: unrecognized arguments: --fatal-message=E"},{"fix":"Install `pylint` separately using `pip install pylint`. Ensure `pylint` is available in the same environment where you are running `pylint-exit`.","cause":"`pylint-exit` acts as a wrapper around the `pylint` command, and `pylint` itself is not found in your system's PATH.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'pylint'"}]}