From be9131644a3f1b8c8c120a544c6e68c68faf0930 Mon Sep 17 00:00:00 2001 From: narrieta Date: Tue, 27 Feb 2024 08:47:31 -0800 Subject: [PATCH 1/2] Fix pylint warnings --- .github/workflows/ci_pr.yml | 4 ++-- ci/pylintrc | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_pr.yml b/.github/workflows/ci_pr.yml index bf308624ab..7de9d58b71 100644 --- a/.github/workflows/ci_pr.yml +++ b/.github/workflows/ci_pr.yml @@ -136,7 +136,7 @@ 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 + # * '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.8), though. # PYLINT_OPTIONS="--rcfile=ci/pylintrc --jobs=0" @@ -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* From e5fd34df4a71660f4cde21818f616eb90aaab53a Mon Sep 17 00:00:00 2001 From: Norberto Arrieta Date: Tue, 27 Feb 2024 09:06:06 -0800 Subject: [PATCH 2/2] Update .github/workflows/ci_pr.yml Co-authored-by: maddieford <93676569+maddieford@users.noreply.github.com> --- .github/workflows/ci_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_pr.yml b/.github/workflows/ci_pr.yml index 7de9d58b71..0c6b816846 100644 --- a/.github/workflows/ci_pr.yml +++ b/.github/workflows/ci_pr.yml @@ -137,7 +137,7 @@ jobs: # * 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.8 and is no longer used by default. It needs - # to be suppressed for previous versions (3.0-3.8), though. + # 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