Skip to content

Commit 039616d

Browse files
committed
Use the make check in tests for code style
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent 198941c commit 039616d

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ dev:
1818

1919
isort:
2020
@echo "-> Apply isort changes to ensure proper imports ordering"
21-
${VENV}/bin/isort --sl -l 100 src tests --skip-glob "*/_packagedcode/*"
21+
${VENV}/bin/isort --sl -l 100 src tests setup.py --skip-glob "*/_packagedcode/*"
2222

2323
black:
2424
@echo "-> Apply black code formatter"
25-
${VENV}/bin/black -l 100 src tests --exclude "_packagedcode/.*"
25+
${VENV}/bin/black -l 100 src tests setup.py --exclude "_packagedcode/.*"
2626

2727
doc8:
2828
@echo "-> Run doc8 validation"
@@ -35,9 +35,9 @@ check:
3535
@${ACTIVATE} pycodestyle --max-line-length=110 \
3636
--exclude=.eggs,etc/scripts,src/_packagedcode,venv,lib,thirdparty,docs .
3737
@echo "-> Run isort imports ordering validation"
38-
@${ACTIVATE} isort --sl --check-only -l 100 src tests --skip-glob "*/_packagedcode/*"
38+
@${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests --skip-glob "*/_packagedcode/*"
3939
@echo "-> Run black validation"
40-
@${ACTIVATE} black --check -l 100 --exclude "_packagedcode/.*"
40+
@${ACTIVATE} black --check -l 100 src tests setup.py --exclude "_packagedcode/.*"
4141

4242
clean:
4343
@echo "-> Clean the Python env"

tests/test_codestyle.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ def test_codestyle(self):
1616
"""
1717
This test shouldn't run in proliferated repositories.
1818
"""
19-
args = "venv/bin/black --check -l 100 setup.py tests src"
19+
args = "make check"
2020
try:
2121
subprocess.check_output(args.split())
2222
except subprocess.CalledProcessError as e:
2323
print("===========================================================")
2424
print(e.output)
2525
print("===========================================================")
2626
raise Exception(
27-
"Black style check failed; please format the code using:\n"
28-
" python -m black -l 100 setup.py tests src",
27+
"Code style check failed!",
2928
e.output,
3029
) from e

0 commit comments

Comments
 (0)