mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
pycodestyle: Check *.in Python files
Many of IPA Python scripts are shebang configurable scripts and have special suffix '.in' for that. Pycodestyle by default check only '*.py' files [0]. [0]: https://pycodestyle.pycqa.org/en/latest/intro.html Fixes: https://pagure.io/freeipa/issue/8961 Signed-off-by: Stanislav Levin <slev@altlinux.org> Reviewed-By: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: François Cami <fcami@redhat.com>
This commit is contained in:
parent
42067e5610
commit
3f134fea38
@ -230,6 +230,8 @@ fasttest: $(GENERATED_PYTHON_FILES) ipasetup.py
|
|||||||
--ignore $(abspath $(top_srcdir))/ipatests/test_xmlrpc
|
--ignore $(abspath $(top_srcdir))/ipatests/test_xmlrpc
|
||||||
|
|
||||||
fastcodestyle: $(GENERATED_PYTHON_FILES) ipasetup.py
|
fastcodestyle: $(GENERATED_PYTHON_FILES) ipasetup.py
|
||||||
|
@ # keep Python files in sync to pycodestyle configuration in
|
||||||
|
@ # tox.ini(filename=)
|
||||||
@echo "Fast code style checking with $(PYTHON) from branch '$(GIT_BRANCH)'"
|
@echo "Fast code style checking with $(PYTHON) from branch '$(GIT_BRANCH)'"
|
||||||
|
|
||||||
@MERGEBASE=$$(git merge-base --fork-point $(GIT_BRANCH)); \
|
@MERGEBASE=$$(git merge-base --fork-point $(GIT_BRANCH)); \
|
||||||
@ -250,8 +252,8 @@ fastcodestyle: $(GENERATED_PYTHON_FILES) ipasetup.py
|
|||||||
echo -e "Fast code style checking for files:\n$${FILES}\n"; \
|
echo -e "Fast code style checking for files:\n$${FILES}\n"; \
|
||||||
echo "pycodestyle"; \
|
echo "pycodestyle"; \
|
||||||
echo "-----------"; \
|
echo "-----------"; \
|
||||||
git diff -U0 $${MERGEBASE} | \
|
git diff -U0 $${MERGEBASE} -- $${FILES} | \
|
||||||
$(PYTHON) -m pycodestyle --diff || exit $$?; \
|
$(PYTHON) -m pycodestyle -v --diff || exit $$?; \
|
||||||
else \
|
else \
|
||||||
echo "No modified Python files found"; \
|
echo "No modified Python files found"; \
|
||||||
fi
|
fi
|
||||||
|
1
tox.ini
1
tox.ini
@ -59,6 +59,7 @@ ignore = E203, E402, E231, W503, E731, E741
|
|||||||
max-line-length = 80
|
max-line-length = 80
|
||||||
# exclude auto-generated remote plugins
|
# exclude auto-generated remote plugins
|
||||||
exclude=.git,.venv,build,_build,rpmbuild,2_49,2_114,2_156,2_164
|
exclude=.git,.venv,build,_build,rpmbuild,2_49,2_114,2_156,2_164
|
||||||
|
filename=*.py,*.in
|
||||||
|
|
||||||
[pytest]
|
[pytest]
|
||||||
addopts = -ra -v
|
addopts = -ra -v
|
||||||
|
Loading…
Reference in New Issue
Block a user