File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ PYLINT_PIP_PKGS =
2121PYLINT_ARGS =
2222PYLINT_DIR = .
2323
24+ # PyCodeStyle
25+ PYCODE_VERSION = latest
26+ PYCODE_ARGS =
27+ PYCODE_DIR = .
28+
2429# Black
2530BLACK_VERSION = latest
2631BLACK_LINT_ARGS = --check --diff
@@ -34,6 +39,7 @@ BLACK_DIR = .
3439.PHONY: lint
3540lint:: lint-mypy
3641lint:: lint-pylint
42+ lint:: lint-pycode
3743lint:: 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
6177lint-black: _lint-black-pull
6278lint-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)"; \
You can’t perform that action at this time.
0 commit comments