Runs one or more linters, but only outputs errors if diffs have lint issues.
lint-diffs is a simple command line tool for running a set of arbitrarty linters on a set of 'unified diffs'.
Errors on diff-lines will always be reported. Errors on non-diff lines can also be reported, depending on severity.
First you need some diffs, then you pipe it to lint-diffs:
git diff -U0 origin/master | lint-diffs
... or in mercurial:
hg outgoing -p | lint-diffs
The default and only preconfigured tool for python is "pylint".
lint-diffs will read a config files from
[pylint] always_report=E.* [flake8] extensions=.py [rubocop] extensions=.rb always_report=(E.*|W.*) [eslint] extensions=.js [shellcheck] extensions=.sh
In this example, a flake8 and pylint are run on every diff file ending in
Additionally, ruby, eslint and shell script linters have been enabled. The
ruby linter has been modified to always report warnings, on any changed file,
not just changed lines.
To add new linters:
- The linter has to report to stdout
- The linter has to have a regex that produces a full file path, a line number and an error class
- The line numbers and file paths have to match diff target file paths
To enable or disable linters change the 'extensions' config.
- Runs with good defaults for many people
- Should be easy to modify the config for any linter
- Should be easy to use with any vcs
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size lint_diffs-0.1.12-py3-none-any.whl (8.1 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size lint_diffs-0.1.12.tar.gz (9.5 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for lint_diffs-0.1.12-py3-none-any.whl