Skip to content

Commit 52a765e

Browse files
authored
Prevent relint from capturing surrounding lines (#26)
1 parent 17f285e commit 52a765e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ If you prefer linting changed files (cached on git) you can use the option
4949

5050
.. code-block:: bash
5151
52-
git diff | relint my_file.py --diff
52+
git diff --unified=0 | relint my_file.py --diff
5353
5454
This option is useful for pre-commit purposes. Here an example of how to use it
5555
with `pre-commit`_ framework:

relint-pre-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

33
set -eo pipefail
4-
git diff --staged | relint --diff -W "${@:1}"
4+
git diff --staged --unified=0 | relint --diff -W "${@:1}"

0 commit comments

Comments
 (0)