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 an arbitrarty linter on a set of 'unified diffs'.
First you need some diffs, then you pipe it to lint-diffs:
git diff -U0 origin/master | 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
command=rubocop app spec
regex=(?P<file>[^:]+):(?P<line>[^:]+):[^:]+: (?P<err>.: [^:]+)
always_report=(E.*|W.*)
In this example, a flake8 and pylint are run on every diff file ending in .py
.
Additionally, a ruby linter has been added.
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
Goals:
- Runs with good defaults for many people
- Should be easy to modify the config for new linters
- Should be easy to use with other 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
lint_diffs-0.1.2.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for lint_diffs-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e79f4957fa0f2ef4067763fdca56f5c3670f2d37fe0b4bb812ed9cfda7dc2e83 |
|
MD5 | aa57a7f17fe5e42e25044818c55922bc |
|
BLAKE2b-256 | a8985d9e8d1547c83f4b341c61701484fddfbf69724819e8f598f8daae6961a8 |