pep8: Return ability to run pylint only on given patches

This commit [1] removed ability to run pylint only on files
that were modified by latest patches. This patch adds it back.

[1] be77ed3a81

Change-Id: Ic6cbe9c9639b976a46fb2858c10c9caf0c998bbf
Signed-off-by: Jakub Libosvar <jlibosva@redhat.com>
This commit is contained in:
Jakub Libosvar
2025-08-28 16:09:17 +00:00
committed by Jakub Libosvar
parent f9067a7190
commit 4b74594a29
3 changed files with 7 additions and 5 deletions

View File

@@ -449,7 +449,7 @@ to run.
To restrict the pylint check to only the files altered by the latest patch
changes::
tox -e pep8 HEAD~1
tox -e pep8 -- HEAD~1
To run only the unit tests::

View File

@@ -28,7 +28,10 @@ process_options () {
run_pylint () {
local target="${scriptargs:-all}"
echo "Running pylint..."
if [ "$target" = "all" ]; then
echo "You can speed this up by running it on 'HEAD~[0-9]' (e.g. HEAD~1, this change only)..."
files="neutron"
else
case "$target" in
@@ -36,9 +39,6 @@ run_pylint () {
*) echo "$target is an unrecognized basecommit"; exit 1;;
esac
fi
echo "Running pylint..."
echo "You can speed this up by running it on 'HEAD~[0-9]' (e.g. HEAD~1, this change only)..."
echo ""
echo "Consider using the 'pre-commit' tool instead."
echo ""

View File

@@ -143,10 +143,12 @@ deps =
pre-commit~=4.0 # MIT
commands =
pre-commit run --all-files --show-diff-on-failure
pylint --rcfile=.pylintrc --output-format=colorized neutron
bash ./tools/coding-checks.sh --pylint '{posargs}'
neutron-db-manage --config-file neutron/tests/etc/neutron.conf check_migration
{[testenv:genconfig]commands}
{[testenv:genpolicy]commands}
allowlist_externals =
bash
[testenv:cover]
description =