diff --git a/dev_tools/conf/.pylintrc b/.pylintrc similarity index 100% rename from dev_tools/conf/.pylintrc rename to .pylintrc 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: 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[@]}"