Runs one or more linters, but only outputs errors if diffs have lint issues.
Project description
lint-diffs
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".
Configuration:
lint-diffs
will read a config files from ~/.config/lint-diffs
and/or ./.lint-diffs
.
Example:
[pylint]
always_report=E.*
[flake8]
extensions=.py
[rubocop]
extensions=.rb
always_report=(E.*|W.*)
[eslint]
extensions=.js
In this example, a flake8 and pylint are run on every diff file ending in .py
.
Additionally, the ruby linter has been enabled, and is set to always report warnings.
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.
Goals:
- 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
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
Hashes for lint_diffs-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 846ecef19d5055951f441dd4fb81b375a0ec7b0a572bf0cca1699bce594de4b2 |
|
MD5 | d3e21d539e51b5efc76e9f69a8946a57 |
|
BLAKE2b-256 | 4111da70b11a7a5524ddde75b015c2e2653fce793898be25745212fb1d6b3279 |