Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pylint warnings #3069

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ jobs:
# so we suppress "bad-option-value".
# * 3.9 will produce "no-member" for several properties/methods that are added to the mocks used by the unit tests (e.g
# "E1101: Instance of 'WireProtocol' has no 'aggregate_status' member") so we suppress that warning.
# * 'no-self-use' ("R0201: Method could be a function") was moved to an optional extension on 3.9 and is no longer used by default. It needs
# to be suppressed for previous versions (3.0-3.8), though.
# * 'no-self-use' ("R0201: Method could be a function") was moved to an optional extension on 3.8 and is no longer used by default. It needs
# to be suppressed for previous versions (3.0-3.7), though.
#
PYLINT_OPTIONS="--rcfile=ci/pylintrc --jobs=0"
if [[ "${{ matrix.python-version }}" == "3.5" ]]; then
Expand All @@ -146,7 +146,7 @@ jobs:
if [[ "${{ matrix.python-version }}" == "3.9" ]]; then
PYLINT_OPTIONS="$PYLINT_OPTIONS --disable=no-member"
fi
if [[ "${{ matrix.python-version }}" =~ ^3\.[0-8]$ ]]; then
if [[ "${{ matrix.python-version }}" =~ ^3\.[0-7]$ ]]; then
PYLINT_OPTIONS="$PYLINT_OPTIONS --disable=no-self-use"
fi

Expand Down
3 changes: 3 additions & 0 deletions ci/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ disable=C, # (C) convention, for programming standard violation
consider-using-dict-comprehension, # R1717: *Consider using a dictionary comprehension*
consider-using-from-import, # R0402: Use 'from foo import bar' instead
consider-using-in, # R1714: *Consider merging these comparisons with "in" to %r*
consider-using-max-builtin, # R1731: Consider using 'a = max(a, b)' instead of unnecessary if block
consider-using-min-builtin, # R1730: Consider using 'a = min(a, b)' instead of unnecessary if block
consider-using-set-comprehension, # R1718: *Consider using a set comprehension*
consider-using-with, # R1732: *Emitted if a resource-allocating assignment or call may be replaced by a 'with' block*
duplicate-code, # R0801: *Similar lines in %s files*
Expand Down Expand Up @@ -35,5 +37,6 @@ disable=C, # (C) convention, for programming standard violation
too-many-statements, # R0915: *Too many statements %s/%s)*
unspecified-encoding, # W1514: Using open without explicitly specifying an encoding
use-a-generator, # R1729: *Use a generator instead '%s%s)'*
use-yield-from, # R1737: Use 'yield from' directly instead of yielding each element one by one
useless-object-inheritance, # R0205: *Class %r inherits from object, can be safely removed from bases in python3*
useless-return, # R1711: *Useless return at end of function or method*
Loading