Skip to content

Commit 595cd30

Browse files
authored
Merge pull request numpy#27113 from rgommers/linter-minor-fix
DEV: make linter.py runnable from outside the root of the repo
2 parents b2d9165 + 4d8c5e0 commit 595cd30

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tools/linter.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
from argparse import ArgumentParser
55
from git import Repo, exc
66

7-
CONFIG = os.path.join(
8-
os.path.abspath(os.path.dirname(__file__)),
9-
'lint_diff.ini',
10-
)
7+
CWD = os.path.abspath(os.path.dirname(__file__))
8+
CONFIG = os.path.join(CWD, 'lint_diff.ini')
119

1210
# NOTE: The `diff` and `exclude` options of pycodestyle seem to be
1311
# incompatible, so instead just exclude the necessary files when
@@ -23,7 +21,7 @@
2321
class DiffLinter:
2422
def __init__(self, branch):
2523
self.branch = branch
26-
self.repo = Repo('.')
24+
self.repo = Repo(os.path.join(CWD, '..'))
2725
self.head = self.repo.head.commit
2826

2927
def get_branch_diff(self, uncommitted = False):

0 commit comments

Comments
 (0)