Skip to content

Commit 0b745fe

Browse files
committed
Add pycodestyle
1 parent 0592c8f commit 0b745fe

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Makefile.python

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ PYLINT_PIP_PKGS =
2121
PYLINT_ARGS =
2222
PYLINT_DIR = .
2323

24+
# PyCodeStyle
25+
PYCODE_VERSION = latest
26+
PYCODE_ARGS =
27+
PYCODE_DIR = .
28+
2429
# Black
2530
BLACK_VERSION = latest
2631
BLACK_LINT_ARGS = --check --diff
@@ -34,6 +39,7 @@ BLACK_DIR = .
3439
.PHONY: lint
3540
lint:: lint-mypy
3641
lint:: lint-pylint
42+
lint:: lint-pycode
3743
lint:: lint-black
3844

3945

@@ -57,6 +63,16 @@ lint-pylint:
5763
docker run --rm $$(tty -s && echo "-it" || echo) -e PIP_ROOT_USER_ACTION=ignore -v $$(pwd):/data -w /data --entrypoint=sh cytopia/pylint:$(PYLINT_VERSION) \
5864
-c 'for pkg in $(PYLINT_PIP_PKGS); do python3 -m pip install $${pkg}; done && pylint $(PYLINT_ARGS) $(PYLINT_DIR)'
5965

66+
.PHONY: lint-pycode
67+
lint-pycode: _lint-pycode-pull
68+
lint-pycode:
69+
@echo "################################################################################"
70+
@echo "# Lint PyCodeStyle"
71+
@echo "################################################################################"
72+
docker run --rm $$(tty -s && echo "-it" || echo) -e PIP_ROOT_USER_ACTION=ignore -v $$(pwd):/data -w /data cytopia/pycodestyle:$(PYCODE_VERSION) \
73+
$(PYCODE_ARGS) \
74+
$(PYCODE_DIR)
75+
6076
.PHONY: lint-black
6177
lint-black: _lint-black-pull
6278
lint-black:
@@ -113,6 +129,19 @@ _lint-pylint-pull:
113129
done; \
114130
if [ "$${SUCC}" = "0" ]; then echo "FAILED"; exit 1; fi;
115131

132+
.PHONY: _lint-pycode-pull
133+
_lint-pycode-pull:
134+
@echo "Pulling cytopia/pycodestyle:$(PYCODE_VERSION)"; \
135+
SUCC=0; \
136+
for i in $$(seq 10); do \
137+
if docker pull -q cytopia/pycodestyle:$(PYCODE_VERSION); then \
138+
SUCC=1; \
139+
break; \
140+
fi; \
141+
sleep 1; \
142+
done; \
143+
if [ "$${SUCC}" = "0" ]; then echo "FAILED"; exit 1; fi;
144+
116145
.PHONY: _lint-black-pull
117146
_lint-black-pull:
118147
@echo "Pulling cytopia/black:$(BLACK_VERSION)"; \

0 commit comments

Comments
 (0)