[pylint-fail-under] Package¶
Pylint wrapper that verifies code reaches a minimum quality score.
Quick Start¶
Execute the pylint-fail-under
command with the same arguments as a pylint
call. In addition,
specify the minimum Pylint quality score with the --fail_under
argument.
If the Pylint score is greater than the fail under value, the script exits successfully with an exit code of zero. For example:
$ pylint-fail-under --fail_under 9.0 my_package
************* Module my_package
my_package\__init__.py:1:0: C0111: Missing module docstring (missing-docstring)
### Pylint output removed for documentation conciseness! ###
my_package\tests\test_my_pkg.py:328:0: C0303: Trailing whitespace (trailing-whitespace)
------------------------------------------------------------------
Your code has been rated at 9.49/10 (previous run: 9.49/10, +0.00)
Otherwise, if the Pylint score is under the minimum, the script exits with a non-zero exit code. For example:
$ pylint-fail-under --fail_under 9.75 my_package
************* Module my_package
my_package\__init__.py:1:0: C0111: Missing module docstring (missing-docstring)
### Pylint output removed for documentation conciseness! ###
my_package\tests\test_my_pkg.py:328:0: C0303: Trailing whitespace (trailing-whitespace)
------------------------------------------------------------------
Your code has been rated at 9.49/10 (previous run: 9.49/10, +0.00)
ERROR: score 9.4921875 is less than fail-under value 9.75
About¶
Contributors¶
- Tyler N. Thieding (Primary Author)
Development¶
Repository: | https://gitlab.com/TNThieding/pylint-fail-under |
---|
License¶
MIT License
Copyright (c) 2019 Tyler Thieding
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
API Reference¶
Command Line Interface¶
$ pylint-fail-under
usage: pylint-fail-under [--fail_under SCORE] [Pylint Command Line Arguments]
Installation¶
Requirements¶
- Python 3.6+
- Windows Vista or Later
Installation Steps¶
Install pylint-fail-under
from the command line using pip:
pip install pylint-fail-under
Release Notes¶
[0.3.0] Return zero exit code when no score parsed. (2019-10-14)¶
Previously, the command line interface returned an exit code of 2
if no score was parsed. In files with
# pylint: disable-all
or a file with no code do not generate a score, this caused a false positive. Now, return
an exit code of 0
if no score is parsed.
Thank you to GitHub user tanishq-dubey for proposing this change and for his original pull request.
[0.2.0] Drop Python 2 support. (2019-06-16)¶
Remove legacy Python 2 syntax from code.
This release includes the following under-the-hood changes:
- Migrate repository from GitHub to GitLab (including CI/CD).
- Pylint cleanup regarding Python 3 syntax.
[0.1.0] Initial beta release. (2019-03-16)¶
Release initial beta version of pylint-fail-under
package with the following features:
- Command line interface to verify that a minimum Pylint score is reached.