Skip to content

Commit

Permalink
Updated pylintrc configuration to version 2.10.x (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Jun 5, 2022
1 parent caa510f commit 3b2629a
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- python-version: '3.10'
toxenv: 'py310'
- python-version: '3.8'
toxenv: 'pylint'
toxenv: 'lint'
container:
image: ubuntu:20.04
steps:
Expand Down
84 changes: 59 additions & 25 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pylint 2.9.x configuration file
# Pylint 2.10.x configuration file
#
# This file is generated by l2tdevtools update-dependencies.py, any dependency
# related changes should be made in dependencies.ini.
Expand Down Expand Up @@ -27,12 +27,13 @@ fail-under=10.0
ignore=CVS

# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against paths.
# regex matches against paths and can be in Posix or Windows format.
ignore-paths=

# Files or directories matching the regex patterns are skipped. The regex
# matches against base names, not paths.
ignore-patterns=
# matches against base names, not paths. The default value ignores emacs file
# locks
ignore-patterns=^\.#

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
Expand All @@ -54,6 +55,13 @@ load-plugins=pylint.extensions.docparams
# Pickle collected data for later comparisons.
persistent=yes

# Minimum Python version to use for version dependent checks. Will default to
# the version used to run pylint.
py-version=3.10

# Discover python modules and packages in the file system subtree.
recursive=yes

# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages.
suggestion-mode=yes
Expand All @@ -66,20 +74,22 @@ unsafe-load-any-extension=no
[MESSAGES CONTROL]

# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
# UNDEFINED.
confidence=

# 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
# disable everything first and then re-enable 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=assignment-from-none,
bad-inline-option,
consider-using-f-string,
deprecated-pragma,
duplicate-code,
eq-without-hash,
Expand Down Expand Up @@ -122,11 +132,11 @@ enable=c-extension-no-member
[REPORTS]

# Python expression which should return a score less than or equal to 10. You
# have access to the variables 'error', 'warning', 'refactor', and 'convention'
# which contain the number of messages in each category, as well as 'statement'
# which is the total number of statements analyzed. This score is used by the
# global evaluation report (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# have access to the variables 'fatal', 'error', 'warning', 'refactor',
# 'convention', and 'info' which contain the number of messages in each
# category, as well as 'statement' which is the total number of statements
# analyzed. This score is used by the global evaluation report (RP0004).
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))

# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details.
Expand Down Expand Up @@ -202,7 +212,7 @@ contextmanager-decorators=contextlib.contextmanager
generated-members=

# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
# class is considered mixin if its name matches the mixin-class-rgx option.
ignore-mixin-members=yes

# Tells whether to warn about missing members when the owner of the attribute
Expand Down Expand Up @@ -240,6 +250,10 @@ missing-member-hint-distance=1
# showing a hint for a missing member.
missing-member-max-choices=1

# Regex pattern to define which classes are considered mixins ignore-mixin-
# members is set to 'yes'
mixin-class-rgx=.*[Mm]ixin

# List of decorators that change the signature of a decorated function.
signature-mutators=

Expand All @@ -261,13 +275,15 @@ logging-modules=logging
argument-naming-style=snake_case

# Regular expression matching correct argument names. Overrides argument-
# naming-style.
# naming-style. If left empty, argument names will be checked with the set
# naming style.
argument-rgx=(([a-z][a-z0-9_]*)|(_[a-z0-9_]*))$

# Naming style matching correct attribute names.
attr-naming-style=snake_case

# Regular expression matching correct attribute names. Overrides attr-naming-
# style. If left empty, attribute names will be checked with the set naming
# style.
attr-rgx=(([a-z][a-z0-9_]*)|(_[a-z0-9_]*))$

Expand All @@ -287,27 +303,30 @@ bad-names-rgxs=
class-attribute-naming-style=any

# Regular expression matching correct class attribute names. Overrides class-
# attribute-naming-style.
# attribute-naming-style. If left empty, class attribute names will be checked
# with the set naming style.
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]*|(__.*__))$

# Naming style matching correct class constant names.
class-const-naming-style=UPPER_CASE

# Regular expression matching correct class constant names. Overrides class-
# const-naming-style.
# const-naming-style. If left empty, class constant names will be checked with
# the set naming style.
#class-const-rgx=

# Naming style matching correct class names.
class-naming-style=PascalCase

# Regular expression matching correct class names. Overrides class-naming-
# style.
# style. If left empty, class names will be checked with the set naming style.
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Naming style matching correct constant names.
const-naming-style=UPPER_CASE

# Regular expression matching correct constant names. Overrides const-naming-
# style. If left empty, constant names will be checked with the set naming
# style.
const-rgx=(([a-zA-Z_][a-zA-Z0-9_]*)|(__.*__))$

Expand All @@ -319,7 +338,8 @@ docstring-min-length=-1
function-naming-style=snake_case

# Regular expression matching correct function names. Overrides function-
# naming-style.
# naming-style. If left empty, function names will be checked with the set
# naming style.
function-rgx=[A-Z_][a-zA-Z0-9_]*$

# Good variable names which should always be accepted, separated by a comma.
Expand All @@ -341,21 +361,22 @@ include-naming-hint=no
inlinevar-naming-style=any

# Regular expression matching correct inline iteration names. Overrides
# inlinevar-naming-style.
# inlinevar-naming-style. If left empty, inline iteration names will be checked
# with the set naming style.
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming style matching correct method names.
method-naming-style=snake_case

# Regular expression matching correct method names. Overrides method-naming-
# style.
# style. If left empty, method names will be checked with the set naming style.
method-rgx=(test|[A-Z_])[a-zA-Z0-9_]*$

# Naming style matching correct module names.
module-naming-style=snake_case

# Regular expression matching correct module names. Overrides module-naming-
# style.
# style. If left empty, module names will be checked with the set naming style.
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Colon-delimited sets of names that determine each other's naming style when
Expand All @@ -371,11 +392,16 @@ no-docstring-rgx=^_
# These decorators are taken in consideration only for invalid-name.
property-classes=abc.abstractproperty

# Regular expression matching correct type variable names. If left empty, type
# variable names will be checked with the set naming style.
#typevar-rgx=

# Naming style matching correct variable names.
variable-naming-style=snake_case

# Regular expression matching correct variable names. Overrides variable-
# naming-style.
# naming-style. If left empty, variable names will be checked with the set
# naming style.
variable-rgx=(([a-z][a-z0-9_]*)|(_[a-z0-9_]*))$


Expand Down Expand Up @@ -451,16 +477,16 @@ spelling-store-unknown-words=no

[SIMILARITIES]

# Ignore comments when computing similarities.
# Comments are removed from the similarity computation
ignore-comments=yes

# Ignore docstrings when computing similarities.
# Docstrings are removed from the similarity computation
ignore-docstrings=yes

# Ignore imports when computing similarities.
# Imports are removed from the similarity computation
ignore-imports=no

# Ignore function signatures when computing similarities.
# Signatures are removed from the similarity computation
ignore-signatures=no

# Minimum lines number of a similarity.
Expand All @@ -480,6 +506,14 @@ check-str-concat-over-line-jumps=no

[DESIGN]

# List of regular expressions of class ancestor names to ignore when counting
# public methods (see R0903)
exclude-too-few-public-methods=

# List of qualified class names to ignore when counting class parents (see
# R0901)
ignored-parents=

# Maximum number of arguments for function / method.
max-args=10

Expand Down
2 changes: 1 addition & 1 deletion run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import unittest

# Change PYTHONPATH to include dependencies.
sys.path.insert(0, u'.')
sys.path.insert(0, '.')

import utils.dependencies # pylint: disable=wrong-import-position

Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py3{6,7,8,9,10},coverage,docs,pylint
envlist = py3{6,7,8,9,10},coverage,docs,lint

[testenv]
pip_pre = True
Expand Down Expand Up @@ -36,15 +36,15 @@ commands =
sphinx-build -b html -d build/doctrees docs dist/docs
sphinx-build -b linkcheck docs dist/docs

[testenv:pylint]
[testenv:lint]
skipsdist=True
pip_pre = True
setenv =
PYTHONPATH = {toxinidir}
deps =
-rrequirements.txt
-rtest_requirements.txt
pylint >= 2.9.0, < 2.10.0
pylint >= 2.10.0, < 2.11.0
commands =
pylint --version
# Ignore setup.py for now due to:
Expand Down
4 changes: 2 additions & 2 deletions utils/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ def __init__(

dependency_reader = DependencyDefinitionReader()

with open(dependencies_file, 'r') as file_object:
with open(dependencies_file, 'r', encoding='utf-8') as file_object:
for dependency in dependency_reader.Read(file_object):
self.dependencies[dependency.name] = dependency

if os.path.exists(test_dependencies_file):
with open(test_dependencies_file, 'r') as file_object:
with open(test_dependencies_file, 'r', encoding='utf-8') as file_object:
for dependency in dependency_reader.Read(file_object):
self._test_dependencies[dependency.name] = dependency

Expand Down

0 comments on commit 3b2629a

Please sign in to comment.