From 3a1092fdcc45512361f449e9a8977adad2822658 Mon Sep 17 00:00:00 2001 From: mhucka Date: Mon, 27 Apr 2026 03:52:08 +0000 Subject: [PATCH 1/3] Move dev_tools/conf/.pylintrc to the top level Move the Pylint config file to a more conventional and easily found location. --- dev_tools/conf/.pylintrc => .pylintrc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename dev_tools/conf/.pylintrc => .pylintrc (100%) diff --git a/dev_tools/conf/.pylintrc b/.pylintrc similarity index 100% rename from dev_tools/conf/.pylintrc rename to .pylintrc From b5dba925cfa8d5ae1f716320a9d51de1d4ea1cd5 Mon Sep 17 00:00:00 2001 From: mhucka Date: Mon, 27 Apr 2026 03:52:39 +0000 Subject: [PATCH 2/3] Update scripts now that `.pylintrc` is at the top level No need to provide an explicit `--rcfile` option. --- check/pylint | 4 ++-- check/pylint-changed-files | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/check/pylint b/check/pylint index 2a3aeb198..9239f8c1d 100755 --- a/check/pylint +++ b/check/pylint @@ -14,7 +14,7 @@ # limitations under the License. ################################################################################ -# Runs pylint on the repository using a preconfigured .pylintrc file. +# Runs pylint from the top level of the project. # # Usage: # check/pylint [--flags] @@ -24,4 +24,4 @@ cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" || exit 1 cd "$(git rev-parse --show-toplevel)" || exit 1 -pylint --rcfile=dev_tools/conf/.pylintrc "$@" src dev_tools +pylint "$@" src dev_tools diff --git a/check/pylint-changed-files b/check/pylint-changed-files index 7f8c2d2dd..69500932a 100755 --- a/check/pylint-changed-files +++ b/check/pylint-changed-files @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Summary: run pylint on changed files using a preconfigured .pylintrc file. +# Summary: run pylint on changed files from the top level of the project. # # Usage: # check/pylint-changed-files [BASE_REVISION] @@ -81,4 +81,4 @@ echo "Found ${num_changed} lintable files associated with changes." >&2 if [ "${num_changed}" -eq 0 ]; then exit 0 fi -env PYTHONPATH=dev_tools pylint --jobs=0 --rcfile=dev_tools/conf/.pylintrc "${changed[@]}" +env PYTHONPATH=dev_tools pylint --jobs=0 "${changed[@]}" From 8f89853600ddac23387fdfa3a63b9b6fe6cf59c2 Mon Sep 17 00:00:00 2001 From: mhucka Date: Mon, 27 Apr 2026 03:52:53 +0000 Subject: [PATCH 3/3] Update instructions about Pylint --- CONTRIBUTING.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ac22d4ca..b7811d38b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,8 +74,6 @@ This project follows Google coding conventions, with a few changes that are most configuration files at the top level of the source tree and in `dev_tools/conf/`. The following files configure various tools to the project conventions: -* `dev_tools/conf/.pylintrc`: Python code - * `.editorconfig`: basic code editor configuration * `.hadolint.yaml`: Dockerfiles @@ -84,6 +82,10 @@ files configure various tools to the project conventions: * `.markdownlintrc`: Markdown files +* `.pylintrc`: Python file lint + +* `.pyproject.toml`: Python tools other than Pylint + * `.yamllint.yaml`: YAML files #### Code comment conventions @@ -220,7 +222,8 @@ check/mypy ### Linting and formatting Code should meet common style standards for Python and be free of error-prone constructs. We use -[Pylint](https://www.pylint.org/) to check for code lint and [Black](https://github.com/psf/black) for formatting code. +[Pylint](https://www.pylint.org/) to check for code lint and [Black](https://github.com/psf/black) +for formatting code. * To check that code is formatted properly after editing Python files: