From ba9b73029ca62292f92ff10d3332275e7d9cf93b Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 21 Jun 2017 12:19:59 -0700 Subject: [PATCH 1/3] Use the short name for checkers instead of their codes --- pylintrc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pylintrc b/pylintrc index 7496fa21689..5a49e7c4a2e 100644 --- a/pylintrc +++ b/pylintrc @@ -1,12 +1,9 @@ [MESSAGES CONTROL] -# For all codes, run 'pylint --list-msgs' or go to 'http://pylint-messages.wikidot.com/all-codes' -# C0111 Missing docstring -# C0103 Invalid %s name "%s" -# I0011 Warning locally suppressed using disable-msg -# W0511 fixme -# R0401 Cyclic import (because of https://github.com/PyCQA/pylint/issues/850) -# R0913 Too many arguments - Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods. -disable=C0111,C0103,I0011,W0511,R0401,R0913 +# For all codes, run 'pylint --list-msgs' or go to 'https://pylint.readthedocs.io/en/latest/reference_guide/features.html' +# locally-disabled: Warning locally suppressed using disable-msg +# cyclic-import: because of https://github.com/PyCQA/pylint/issues/850 +# too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods. +disable=missing-docstring,invalid-name,locally-disabled,fixme,cyclic-import,too-many-arguments [FORMAT] max-line-length=120 From b4cd12ccf56828f0ba8dc0c807de65408a85d35b Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 21 Jun 2017 13:31:38 -0700 Subject: [PATCH 2/3] Add naming hints --- pylintrc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pylintrc b/pylintrc index 5a49e7c4a2e..a43fb61d88e 100644 --- a/pylintrc +++ b/pylintrc @@ -3,7 +3,7 @@ # locally-disabled: Warning locally suppressed using disable-msg # cyclic-import: because of https://github.com/PyCQA/pylint/issues/850 # too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods. -disable=missing-docstring,invalid-name,locally-disabled,fixme,cyclic-import,too-many-arguments +disable=missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name [FORMAT] max-line-length=120 @@ -21,3 +21,20 @@ max-branches=20 [SIMILARITIES] min-similarity-lines=10 +[BASIC] +# Naming hints based on PEP 8 (https://www.python.org/dev/peps/pep-0008/#naming-conventions). +# Consider these guidelines and not hard rules. Read PEP 8 for more details. + +# The invalid-name checker must be **enabled** for these hints to be used. +include-naming-hint=yes + +module-name-hint=lowercase (short; underscores are discouraged) +const-name-hint=UPPER_CASE_WITH_UNDERSCORES +class-name-hint=CapitalizedWords +class-attribute-name-hint=lower_case_with_underscores +attr-name-hint=lower_case_with_underscores +method-name-hint=lower_case_with_underscores +function-name-hint=lower_case_with_underscores +argument-name-hint=lower_case_with_underscores +variable-name-hint=lower_case_with_underscores +inlinevar-name-hint=lower_case_with_underscores (short is OK) From 2fa2bb7c890b127bb6575662a538102bdddcb8f3 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 21 Jun 2017 13:46:00 -0700 Subject: [PATCH 3/3] Tweak module naming hint --- pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylintrc b/pylintrc index a43fb61d88e..87c5b4d4092 100644 --- a/pylintrc +++ b/pylintrc @@ -28,7 +28,7 @@ min-similarity-lines=10 # The invalid-name checker must be **enabled** for these hints to be used. include-naming-hint=yes -module-name-hint=lowercase (short; underscores are discouraged) +module-name-hint=lowercase (keep short; underscores are discouraged) const-name-hint=UPPER_CASE_WITH_UNDERSCORES class-name-hint=CapitalizedWords class-attribute-name-hint=lower_case_with_underscores