diff --git a/.github/workflows/ci_pr.yml b/.github/workflows/ci_pr.yml index bf308624ab..0c6b816846 100644 --- a/.github/workflows/ci_pr.yml +++ b/.github/workflows/ci_pr.yml @@ -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 @@ -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 diff --git a/ci/pylintrc b/ci/pylintrc index 7625abad43..f57949ab72 100644 --- a/ci/pylintrc +++ b/ci/pylintrc @@ -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* @@ -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*