diff --git a/.gitignore b/.gitignore index df4fe06fa5aee..dbce921dd1eb2 100644 --- a/.gitignore +++ b/.gitignore @@ -56,7 +56,8 @@ coverage.xml system_tests/local_test_setup # Make sure a generated file isn't accidentally committed. -scripts/pylintrc_reduced +pylintrc +pylintrc.test # Directories used for creating generated PB2 files generated_python/ diff --git a/core/nox.py b/core/nox.py index d941d60092b81..38268bcd2f904 100644 --- a/core/nox.py +++ b/core/nox.py @@ -14,8 +14,6 @@ from __future__ import absolute_import -import os - import nox @@ -43,15 +41,22 @@ def unit_tests(session, python_version): @nox.session def lint(session): - """Run flake8. + """Run linters. - Returns a failure if flake8 finds linting errors or sufficiently + Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ session.interpreter = 'python3.6' - session.install('flake8') + session.install('flake8', 'pylint', 'gcp-devrel-py-tools') session.install('.') session.run('flake8', 'google/cloud/core') + session.run( + 'gcp-devrel-py-tools', 'run-pylint', + '--config', 'pylint.config.py', + '--library-filesets', 'google', + '--test-filesets', 'tests', + # Temporarily allow this to fail. + success_codes=range(0, 100)) @nox.session diff --git a/core/pylint.config.py b/core/pylint.config.py new file mode 100644 index 0000000000000..d8ca7b92e85ee --- /dev/null +++ b/core/pylint.config.py @@ -0,0 +1,25 @@ +# Copyright 2017 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This module is used to configure gcp-devrel-py-tools run-pylint.""" + +# Library configuration + +# library_additions = {} +# library_replacements = {} + +# Test configuration + +# test_additions = copy.deepcopy(library_additions) +# test_replacements = copy.deepcopy(library_replacements)