From a4771d4fd2a67abc83ae9d33a7c6bb073263e393 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 13:59:46 -0400 Subject: [PATCH 01/20] .landscape.yml: Fix typo. --- .landscape.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.landscape.yml b/.landscape.yml index 0831cdba..bffdf838 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -48,7 +48,7 @@ pylint: - C0103 # Ignore complaint about superfluous parentheses after keywords. - C0325 - # Skip complaint about using start args as they have a very clear + # Skip complaint about using star args as they have a very clear # and frequent use in our codebase when forwarding arguments to # nested callables. - W0142 From cba69f6f0b1b944783d3875b8f9777be3e719fc3 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 14:02:18 -0400 Subject: [PATCH 02/20] .landscape.yml: Wrap comments. --- .landscape.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.landscape.yml b/.landscape.yml index bffdf838..eb31bdae 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -43,14 +43,14 @@ pyflakes: pylint: run: true disable: - # Skip complaint about invalid name. More often than not the names - # are clear and if anything follow this guideline; so, it is ignored. + # Skip complaint about invalid name. More often than not the names are + # clear and if anything follow this guideline; so, it is ignored. - C0103 # Ignore complaint about superfluous parentheses after keywords. - C0325 - # Skip complaint about using star args as they have a very clear - # and frequent use in our codebase when forwarding arguments to - # nested callables. + # Skip complaint about using star args as they have a very clear and + # frequent use in our codebase when forwarding arguments to nested + # callables. - W0142 # Skip complaint about using backslash literals in multiline strings. - W1401 From c69524599edb022f2e67f12ae66eacff897b7f04 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:01:08 -0400 Subject: [PATCH 03/20] setup.cfg: Add PEP8 settings. --- setup.cfg | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.cfg b/setup.cfg index 1c1a6254..9a2e5f6a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,3 +13,13 @@ versionfile_source=nanshe/_version.py versionfile_build= tag_prefix=v parentdir_prefix=nanshe- +[pep8] +# PEP8 says we shouldn't have any global variables before imports. +# Generally, this sounds like a good idea. However, it is nice to +# have our `__author__` and `__date__` lines near our module or +# package docstring, which technically are global variables. +# Hence, we ignore PEP8 here. To quote PEP8, "Consistency with +# this style guide is important. Consistency within a project is +# more important. Consistency within one module or function is +# most important." +ignore=E402 From 0c482c0ae880f33912f2c97822f429dfab07bbe2 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:01:41 -0400 Subject: [PATCH 04/20] setup.all.cfg: Add PEP8 settings. --- setup.all.cfg | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.all.cfg b/setup.all.cfg index 951b8bdc..0f1837b9 100644 --- a/setup.all.cfg +++ b/setup.all.cfg @@ -12,3 +12,13 @@ versionfile_source=nanshe/_version.py versionfile_build= tag_prefix=v parentdir_prefix=nanshe- +[pep8] +# PEP8 says we shouldn't have any global variables before imports. +# Generally, this sounds like a good idea. However, it is nice to +# have our `__author__` and `__date__` lines near our module or +# package docstring, which technically are global variables. +# Hence, we ignore PEP8 here. To quote PEP8, "Consistency with +# this style guide is important. Consistency within a project is +# more important. Consistency within one module or function is +# most important." +ignore=E402 From 5f63c1a0773dd4ee681bc080fc2046cb7db59123 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:01:49 -0400 Subject: [PATCH 05/20] .landscape.yml: Drop PEP8 details. --- .landscape.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.landscape.yml b/.landscape.yml index eb31bdae..5031936b 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -10,16 +10,6 @@ max-line-length: 79 # Use some standard linting tools. pep8: full: true - disable: - # PEP8 says we shouldn't have any global variables before imports. - # Generally, this sounds like a good idea. However, it is nice to - # have our `__author__` and `__date__` lines near our module or - # package docstring, which technically are global variables. - # Hence, we ignore PEP8 here. To quote PEP8, "Consistency with - # this style guide is important. Consistency within a project is - # more important. Consistency within one module or function is - # most important." - - E402 # Check docstring coverage and style. pep257: run: true From 6044090b109b062afc78c8eaccc009e0a300e40a Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:08:45 -0400 Subject: [PATCH 06/20] setup.cfg: Clean up comment about PEP8 - E402. --- setup.cfg | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup.cfg b/setup.cfg index 9a2e5f6a..7dacaf1e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,12 +14,12 @@ versionfile_build= tag_prefix=v parentdir_prefix=nanshe- [pep8] -# PEP8 says we shouldn't have any global variables before imports. -# Generally, this sounds like a good idea. However, it is nice to -# have our `__author__` and `__date__` lines near our module or -# package docstring, which technically are global variables. -# Hence, we ignore PEP8 here. To quote PEP8, "Consistency with -# this style guide is important. Consistency within a project is -# more important. Consistency within one module or function is -# most important." +# E402 +#### PEP8 says we shouldn't have any global variables before imports. +#### Generally, this sounds like a good idea. However, it is nice to have our +#### `__author__` and `__date__` lines near our module or package docstring, +#### which technically are global variables. Hence, we ignore PEP8 here. To +#### quote PEP8, "Consistency with this style guide is important. Consistency +#### within a project is more important. Consistency within one module or +#### function is most important." ignore=E402 From a82c986aadc98ad6eb5522d56d29163d7736f07c Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:09:29 -0400 Subject: [PATCH 07/20] setup.all.cfg: Clean up comment about PEP8 - E402. --- setup.all.cfg | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/setup.all.cfg b/setup.all.cfg index 0f1837b9..73a01f84 100644 --- a/setup.all.cfg +++ b/setup.all.cfg @@ -13,12 +13,11 @@ versionfile_build= tag_prefix=v parentdir_prefix=nanshe- [pep8] -# PEP8 says we shouldn't have any global variables before imports. -# Generally, this sounds like a good idea. However, it is nice to -# have our `__author__` and `__date__` lines near our module or -# package docstring, which technically are global variables. -# Hence, we ignore PEP8 here. To quote PEP8, "Consistency with -# this style guide is important. Consistency within a project is -# more important. Consistency within one module or function is -# most important." +# E402 +#### PEP8 says we shouldn't have any global variables before imports. +#### Generally, this sounds like a good idea. However, it is nice to have our +#### `__author__` and `__date__` lines near our module or package docstring, +#### which technically are global variables. Hence, we ignore PEP8 here. To +#### quote PEP8, "Consistency with this style guide is important. Consistency +#### within a project is more important. Consistency within one module or ignore=E402 From 25531f2232ef67600fe04fc6e82e9e47da4047a6 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:10:36 -0400 Subject: [PATCH 08/20] setup.cfg: Add settings for PEP257. --- setup.cfg | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup.cfg b/setup.cfg index 7dacaf1e..6a247501 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,3 +23,18 @@ parentdir_prefix=nanshe- #### within a project is more important. Consistency within one module or #### function is most important." ignore=E402 +[pep257] +# D202 +#### Ignore constraint disallowing newlines to follow docstrings. We find +#### having a newline there makes it easier to read on a quick pass. +# D203 +#### Ignore constraint about having a newline between class definition and +#### docstrings. +# D208 +#### PEP257 expects the documentation to be indented the same as the code. We +#### have preferred to indent it one time further as it makes it easier on the +#### eye to note documentation from code on a quick pass. So, we suppress this +#### constraint. +# D301 +#### Ignore suggestion about handling backslashes in docstrings. +ignore=D202,D203,D208,D301 From 0a0195fc15ac012c05e34ac6918a60831f92622f Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:11:14 -0400 Subject: [PATCH 09/20] setup.all.cfg: Add settings for PEP257. --- setup.all.cfg | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup.all.cfg b/setup.all.cfg index 73a01f84..ad366cf0 100644 --- a/setup.all.cfg +++ b/setup.all.cfg @@ -21,3 +21,18 @@ parentdir_prefix=nanshe- #### quote PEP8, "Consistency with this style guide is important. Consistency #### within a project is more important. Consistency within one module or ignore=E402 +[pep257] +# D202 +#### Ignore constraint disallowing newlines to follow docstrings. We find +#### having a newline there makes it easier to read on a quick pass. +# D203 +#### Ignore constraint about having a newline between class definition and +#### docstrings. +# D208 +#### PEP257 expects the documentation to be indented the same as the code. We +#### have preferred to indent it one time further as it makes it easier on the +#### eye to note documentation from code on a quick pass. So, we suppress this +#### constraint. +# D301 +#### Ignore suggestion about handling backslashes in docstrings. +ignore=D202,D203,D208,D301 From b596e260d76aa8ad0dae300ea0ae39e9f47816a9 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:15:32 -0400 Subject: [PATCH 10/20] .landscape.yml: Drop PEP257 configuration. --- .landscape.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.landscape.yml b/.landscape.yml index 5031936b..f0e6aa04 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -13,21 +13,6 @@ pep8: # Check docstring coverage and style. pep257: run: true - disable: - # Ignore constraint disallowing newlines to follow docstrings. - # We find having a newline there makes it easier to read on a - # quick pass. - - D202 - # Ignore constraint about having a newline between class - # definition and docstrings. - - D203 - # PEP257 expects the documentation to be indented the same as - # the code. We have preferred to indent it one time further as it - # makes it easier on the eye to note documentation from code on - # a quick pass. So, we suppress this constraint. - - D208 - # Ignore suggestion about handling backslashes in docstrings. - - D301 pyflakes: run: true pylint: From e12c79e6d206d6fe8cab785562405e0867b9e89d Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:33:16 -0400 Subject: [PATCH 11/20] pylintrc: Add default pylint config file. --- pylintrc | 390 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 390 insertions(+) create mode 100644 pylintrc diff --git a/pylintrc b/pylintrc new file mode 100644 index 00000000..8b08bca9 --- /dev/null +++ b/pylintrc @@ -0,0 +1,390 @@ +[MASTER] + +# Specify a configuration file. +#rcfile= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Profiled execution. +profile=no + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Pickle collected data for later comparisons. +persistent=yes + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Deprecated. It was used to include message's id in output. Use --msg-template +# instead. +include-ids=no + +# Deprecated. It was used to include symbolic ids of messages in output. Use +# --msg-template instead. +symbols=no + +# Use multiple processes to speed up Pylint. +jobs=1 + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist= + +# Allow optimization of some AST trees. This will activate a peephole AST +# optimizer, which will apply various small optimizations. For instance, it can +# be used to obtain the result of joining multiple strings with the addition +# operator. Joining a lot of strings can lead to a maximum recursion error in +# Pylint and this flag can prevent that. It has one side effect, the resulting +# AST will be different than the one from reality. +optimize-ast=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time. See also the "--disable" option for examples. +#enable= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=E1608,W1627,E1601,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,W1638,I0020,W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1632,W1633,W0704,W1628,W1629,W1636 + + +[REPORTS] + +# Set the output format. Available formats are text, parseable, colorized, msvs +# (visual studio) and html. You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Put messages in a separate file for each module / package specified on the +# command line instead of printing them on stdout. Reports (if any) will be +# written in a file name "pylint_global.[txt|html]". +files-output=no + +# Tells whether to display a full report or only the messages +reports=yes + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Add a comment according to your evaluation note. This is used by the global +# evaluation report (RP0004). +comment=no + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + + +[BASIC] + +# Required attributes for module, separated by a comma +required-attributes= + +# List of builtins function names that should not be used, separated by a comma +bad-functions=map,filter,input + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Regular expression matching correct function names +function-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for function names +function-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct variable names +variable-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for variable names +variable-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct attribute names +attr-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for attribute names +attr-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct argument names +argument-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for argument names +argument-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming hint for class names +class-name-hint=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct method names +method-rgx=[a-z_][a-z0-9_]{2,30}$ + +# Naming hint for method names +method-name-hint=[a-z_][a-z0-9_]{2,30}$ + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=__.*__ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + + +[FORMAT] + +# Maximum number of characters on a single line. +max-line-length=100 + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + +# List of optional constructs for which whitespace checking is disabled +no-space-check=trailing-comma,dict-separator + +# Maximum number of lines in a module +max-module-lines=1000 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[SIMILARITIES] + +# Minimum lines number of a similarity. +min-similarity-lines=4 + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[TYPECHECK] + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis +ignored-modules= + +# List of classes names for which member attributes should not be checked +# (useful for classes with attributes dynamically set). +ignored-classes=SQLObject + +# When zope mode is activated, add a predefined set of Zope acquired attributes +# to generated-members. +zope=no + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E0201 when accessed. Python regular +# expressions are accepted. +generated-members=REQUEST,acl_users,aq_parent + + +[VARIABLES] + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_$|dummy + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + + +[CLASSES] + +# List of interface methods to ignore, separated by a comma. This is used for +# instance to not check methods defines in Zope's Interface base class. +ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.* + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of statements in function / method body +max-statements=50 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + + +[IMPORTS] + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=regsub,TERMIOS,Bastion,rexec + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception From ab9abea16e472af3adf39007107c5d8104c9ac06 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:33:57 -0400 Subject: [PATCH 12/20] pylintrc: Disable some warnings from landscape.io. --- pylintrc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pylintrc b/pylintrc index 8b08bca9..a5f0c013 100644 --- a/pylintrc +++ b/pylintrc @@ -70,7 +70,23 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=E1608,W1627,E1601,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,W1638,I0020,W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1632,W1633,W0704,W1628,W1629,W1636 + +# C0103 +#### Skip complaint about invalid name. More often than not the names +#### are clear and if anything follow this guideline; so, it is ignored. + +# C0325 +#### Ignore complaint about superfluous parentheses after keywords. + +# W0142 +#### Skip complaint about using star args as they have a very clear +#### and frequent use in our codebase when forwarding arguments to +#### nested callables. + +# W1401 +#### Skip complaint about using backslash literals in multiline strings. + +disable=E1608,W1627,E1601,W1401,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,C0325,W1638,I0020,C0103,W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1632,W1633,W0704,W1628,W1629,W1636 [REPORTS] From 9d5b95e40f2a0b56bbd773b9a6ea60838514ae02 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 12:34:56 -0400 Subject: [PATCH 13/20] .landscape.yml: Remove settings for pylint as they have been moved to pylintrc. --- .landscape.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.landscape.yml b/.landscape.yml index f0e6aa04..2bed6e4f 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -17,18 +17,6 @@ pyflakes: run: true pylint: run: true - disable: - # Skip complaint about invalid name. More often than not the names are - # clear and if anything follow this guideline; so, it is ignored. - - C0103 - # Ignore complaint about superfluous parentheses after keywords. - - C0325 - # Skip complaint about using star args as they have a very clear and - # frequent use in our codebase when forwarding arguments to nested - # callables. - - W0142 - # Skip complaint about using backslash literals in multiline strings. - - W1401 # Analyze our `setup.py`. pyroma: run: true From 9d0fcb3a1433e46277802bb5ba1cde43464aadf0 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Fri, 15 May 2015 14:54:36 -0400 Subject: [PATCH 14/20] .landscape.yml: Try adding pylintrc file to config. --- .landscape.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.landscape.yml b/.landscape.yml index 2bed6e4f..7bceb0e6 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -17,6 +17,7 @@ pyflakes: run: true pylint: run: true + rcfile: pylintrc # Analyze our `setup.py`. pyroma: run: true From d871abcca92174bf526784806a7dccc9e93aed82 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Wed, 10 Aug 2016 14:43:20 -0400 Subject: [PATCH 15/20] pylintrc: Disable different warnings. --- pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylintrc b/pylintrc index a5f0c013..913d7d32 100644 --- a/pylintrc +++ b/pylintrc @@ -86,7 +86,7 @@ confidence= # W1401 #### Skip complaint about using backslash literals in multiline strings. -disable=E1608,W1627,E1601,W1401,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,C0325,W1638,I0020,C0103,W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,W1632,W1633,W0704,W1628,W1629,W1636 +disable=C0103,C0325,W0142,W1401 [REPORTS] From 290cdbd27fab27218d7c40d352f5808f80122607 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Wed, 10 Aug 2016 15:56:53 -0400 Subject: [PATCH 16/20] pylintrc -> .pylintrc --- pylintrc => .pylintrc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pylintrc => .pylintrc (100%) diff --git a/pylintrc b/.pylintrc similarity index 100% rename from pylintrc rename to .pylintrc From 5e77c2c2fd309f44fee040913185310976742f33 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Wed, 10 Aug 2016 16:30:33 -0400 Subject: [PATCH 17/20] pylintrc: Regenerate an RC. --- .pylintrc | 121 +++++++++++++++++++++++++++--------------------------- 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/.pylintrc b/.pylintrc index 913d7d32..7b7a5555 100644 --- a/.pylintrc +++ b/.pylintrc @@ -7,13 +7,14 @@ # pygtk.require(). #init-hook= -# Profiled execution. -profile=no - # Add files or directories to the blacklist. They should be base names, not # paths. ignore=CVS +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + # Pickle collected data for later comparisons. persistent=yes @@ -21,14 +22,6 @@ persistent=yes # usually to register additional checkers. load-plugins= -# Deprecated. It was used to include message's id in output. Use --msg-template -# instead. -include-ids=no - -# Deprecated. It was used to include symbolic ids of messages in output. Use -# --msg-template instead. -symbols=no - # Use multiple processes to speed up Pylint. jobs=1 @@ -46,7 +39,8 @@ extension-pkg-whitelist= # be used to obtain the result of joining multiple strings with the addition # operator. Joining a lot of strings can lead to a maximum recursion error in # Pylint and this flag can prevent that. It has one side effect, the resulting -# AST will be different than the one from reality. +# AST will be different than the one from reality. This option is deprecated +# and it will be removed in Pylint 2.0. optimize-ast=no @@ -58,7 +52,8 @@ confidence= # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option -# multiple time. See also the "--disable" option for examples. +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. #enable= # Disable the message, report, category or checker with the given id(s). You @@ -70,23 +65,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" - -# C0103 -#### Skip complaint about invalid name. More often than not the names -#### are clear and if anything follow this guideline; so, it is ignored. - -# C0325 -#### Ignore complaint about superfluous parentheses after keywords. - -# W0142 -#### Skip complaint about using star args as they have a very clear -#### and frequent use in our codebase when forwarding arguments to -#### nested callables. - -# W1401 -#### Skip complaint about using backslash literals in multiline strings. - -disable=C0103,C0325,W0142,W1401 +disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating [REPORTS] @@ -98,7 +77,8 @@ output-format=text # Put messages in a separate file for each module / package specified on the # command line instead of printing them on stdout. Reports (if any) will be -# written in a file name "pylint_global.[txt|html]". +# written in a file name "pylint_global.[txt|html]". This option is deprecated +# and it will be removed in Pylint 2.0. files-output=no # Tells whether to display a full report or only the messages @@ -111,10 +91,6 @@ reports=yes # (RP0004). evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) -# Add a comment according to your evaluation note. This is used by the global -# evaluation report (RP0004). -comment=no - # Template used to display messages. This is a python new-style format string # used to format the message information. See doc for all details #msg-template= @@ -122,12 +98,6 @@ comment=no [BASIC] -# Required attributes for module, separated by a comma -required-attributes= - -# List of builtins function names that should not be used, separated by a comma -bad-functions=map,filter,input - # Good variable names which should always be accepted, separated by a comma good-names=i,j,k,ex,Run,_ @@ -141,6 +111,10 @@ name-group= # Include a hint for the correct naming format with invalid-name include-naming-hint=no +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + # Regular expression matching correct function names function-rgx=[a-z_][a-z0-9_]{2,30}$ @@ -203,13 +177,19 @@ method-name-hint=[a-z_][a-z0-9_]{2,30}$ # Regular expression which should only match function or class names that do # not require a docstring. -no-docstring-rgx=__.*__ +no-docstring-rgx=^_ # Minimum line length for functions/classes that require docstrings, shorter # ones are exempt. docstring-min-length=-1 +[ELIF] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + [FORMAT] # Maximum number of characters on a single line. @@ -222,17 +202,20 @@ ignore-long-lines=^\s*(# )??$ # else. single-line-if-stmt=no -# List of optional constructs for which whitespace checking is disabled +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. no-space-check=trailing-comma,dict-separator # Maximum number of lines in a module max-module-lines=1000 -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 # tab). indent-string=' ' -# Number of spaces of indent required inside a hanging or continued line. +# Number of spaces of indent required inside a hanging or continued line. indent-after-paren=4 # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. @@ -292,21 +275,24 @@ ignore-mixin-members=yes # List of module names for which member attributes should not be checked # (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. ignored-modules= -# List of classes names for which member attributes should not be checked -# (useful for classes with attributes dynamically set). -ignored-classes=SQLObject - -# When zope mode is activated, add a predefined set of Zope acquired attributes -# to generated-members. -zope=no +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local # List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E0201 when accessed. Python regular +# system, and so shouldn't trigger E1101 when accessed. Python regular # expressions are accepted. -generated-members=REQUEST,acl_users,aq_parent +generated-members= + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager [VARIABLES] @@ -316,7 +302,7 @@ init-import=no # A regular expression matching the name of dummy variables (i.e. expectedly # not used). -dummy-variables-rgx=_$|dummy +dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy # List of additional names supposed to be defined in builtins. Remember that # you should avoid to define new builtins when possible. @@ -326,12 +312,12 @@ additional-builtins= # name must start or end with one of those strings. callbacks=cb_,_cb +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins -[CLASSES] -# List of interface methods to ignore, separated by a comma. This is used for -# instance to not check methods defines in Zope's Interface base class. -ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by +[CLASSES] # List of method names used to declare (i.e. assign) instance attributes. defining-attr-methods=__init__,__new__,setUp @@ -380,6 +366,9 @@ min-public-methods=2 # Maximum number of public methods for a class (see R0904). max-public-methods=20 +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + [IMPORTS] @@ -398,6 +387,18 @@ ext-import-graph= # not be disabled) int-import-graph= +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + [EXCEPTIONS] From a6d916de23b896638c873b90febdb06c33c54c99 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Wed, 10 Aug 2016 16:35:09 -0400 Subject: [PATCH 18/20] pylintrc: Add some more warnings to ignore. --- .pylintrc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 7b7a5555..3155a17a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -65,7 +65,20 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating + +# +# C0103 - Skip complaint about invalid name. More often than not the names are +# clear and if anything follow this guideline; so, it is ignored. +# +# C0325 - Ignore complaint about superfluous parentheses after keywords. +# +# W0142 - Skip complaint about using star args as they have a very clear and +# frequent use in our codebase when forwarding arguments to nested +# callables. +# +# W1401 - Skip complaint about using backslash literals in multiline strings. +# +disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating,C0103,C0325,W0142,W1401 [REPORTS] From 7563649e5cdd2f5398ec6e94860afc9e4fd7dad1 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Wed, 10 Aug 2016 17:38:37 -0400 Subject: [PATCH 19/20] Revert ".landscape.yml: Drop PEP257 configuration." This reverts commit b596e260d76aa8ad0dae300ea0ae39e9f47816a9. --- .landscape.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.landscape.yml b/.landscape.yml index 7bceb0e6..51fad593 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -13,6 +13,21 @@ pep8: # Check docstring coverage and style. pep257: run: true + disable: + # Ignore constraint disallowing newlines to follow docstrings. + # We find having a newline there makes it easier to read on a + # quick pass. + - D202 + # Ignore constraint about having a newline between class + # definition and docstrings. + - D203 + # PEP257 expects the documentation to be indented the same as + # the code. We have preferred to indent it one time further as it + # makes it easier on the eye to note documentation from code on + # a quick pass. So, we suppress this constraint. + - D208 + # Ignore suggestion about handling backslashes in docstrings. + - D301 pyflakes: run: true pylint: From 091bd26cd7986111c67402552befb2192bc0a994 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Wed, 10 Aug 2016 17:45:42 -0400 Subject: [PATCH 20/20] landscape: Drop pylint rcfile config. --- .landscape.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.landscape.yml b/.landscape.yml index 51fad593..10772a7e 100644 --- a/.landscape.yml +++ b/.landscape.yml @@ -32,7 +32,6 @@ pyflakes: run: true pylint: run: true - rcfile: pylintrc # Analyze our `setup.py`. pyroma: run: true