From 04c1466c44cec7a9c20e9eef8f480875907d0e3c Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 8 Jan 2021 13:40:58 +0000 Subject: [PATCH] Enable pylint Related-Bug: #1910543 Change-Id: I8cba98b97ebb6d18fce84c86cceb5c30b93dd194 --- .pre-commit-config.yaml | 4 ++ .pylintrc | 79 +++++++++++++++++++++++++++++++++++++ doc/source/conf.py | 3 +- releasenotes/source/conf.py | 3 +- 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 .pylintrc diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1ef5d8c39..6c92f3a2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,3 +7,7 @@ repos: language_version: python3 args: ['--config=setup.cfg'] pass_filenames: false + - repo: https://github.com/pre-commit/mirrors-pylint + rev: v2.6.0 + hooks: + - id: pylint diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 000000000..b3669826b --- /dev/null +++ b/.pylintrc @@ -0,0 +1,79 @@ +[MESSAGES CONTROL] + +disable = + # TODO(ssbarnea): remove temporary skips added during initial adoption: + arguments-differ, + assignment-from-no-return, + attribute-defined-outside-init, + broad-except, + consider-iterating-dictionary, + consider-merging-isinstance, + consider-using-dict-comprehension, + consider-using-in, + consider-using-set-comprehension, + dangerous-default-value, + deprecated-method, + duplicate-code, + expression-not-assigned, + fixme, + global-statement, + import-error, + import-outside-toplevel, + inconsistent-return-statements, + invalid-name, + line-too-long, + logging-format-interpolation, + logging-not-lazy, + lost-exception, + missing-class-docstring, + missing-function-docstring, + missing-module-docstring, + no-else-break, + no-else-continue, + no-else-raise, + no-else-return, + no-member, + no-self-use, + no-value-for-parameter, + protected-access, + raise-missing-from, + redefined-argument-from-local, + redefined-builtin, + redefined-outer-name, + reimported, + self-assigning-variable, + simplifiable-if-statement, + super-init-not-called, + super-with-arguments, + superfluous-parens, + too-few-public-methods, + too-many-ancestors, + too-many-arguments, + too-many-branches, + too-many-instance-attributes, + too-many-lines, + too-many-locals, + too-many-nested-blocks, + too-many-public-methods, + too-many-return-statements, + too-many-statements, + trailing-comma-tuple, + try-except-raise, + undefined-loop-variable, + ungrouped-imports, + unidiomatic-typecheck, + unnecessary-comprehension, + unnecessary-lambda, + unnecessary-pass, + unsubscriptable-object, + unused-argument, + unused-import, + unused-variable, + useless-else-on-loop, + useless-object-inheritance, + useless-super-delegation, + wrong-import-order, + wrong-import-position + +[REPORTS] +output-format = colorized diff --git a/doc/source/conf.py b/doc/source/conf.py index acca9c67b..ffcbd60ec 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -12,7 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, sys +import os +import sys sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index a9d6fae38..dcccc3e52 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -187,7 +187,8 @@ htmlhelp_basename = 'python-tripleoclientReleaseNotesdoc' # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'python-tripleoclientReleaseNotes.tex', u'python-tripleoclient Release Notes Documentation', + ('index', 'python-tripleoclientReleaseNotes.tex', + u'python-tripleoclient Release Notes Documentation', u'2016, TripleO Developers', 'manual'), ]