pylint 3.3.9 astroid 3.3.8 Python 3.14.2 (main, Dec 5 2025, 00:00:00) [GCC 15.2.1 20251111 (Red Hat 15.2.1-4)] Redirect to /tmp/tmp.L0ZvIHQikC and /tmp/tmp.acWPxGTHo7 Tree base: f775a673c165 ("tools: ynl-gen-c: suppress unhelpful pylint messages") Now at: 83b654182e3d ("tools: ynl-gen-c: fix pylint warnings for returns, unused, redefined") ====== Checking before the patch ====== ************* Module pyynl.ynl_gen_c tools/net/ynl/pyynl/ynl_gen_c.py:1050:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens) tools/net/ynl/pyynl/ynl_gen_c.py:1052:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens) tools/net/ynl/pyynl/ynl_gen_c.py:2718:0: W0311: Bad indentation. Found 8 spaces, expected 4 (bad-indentation) tools/net/ynl/pyynl/ynl_gen_c.py:3437:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens) tools/net/ynl/pyynl/ynl_gen_c.py:884:0: R1707: Disallow trailing comma tuple (trailing-comma-tuple) tools/net/ynl/pyynl/ynl_gen_c.py:1:0: C0114: Missing module docstring (missing-module-docstring) tools/net/ynl/pyynl/ynl_gen_c.py:165:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) tools/net/ynl/pyynl/ynl_gen_c.py:177:35: W0613: Unused argument 'ri' (unused-argument) tools/net/ynl/pyynl/ynl_gen_c.py:183:26: W0613: Unused argument 'ri' (unused-argument) tools/net/ynl/pyynl/ynl_gen_c.py:197:25: E1136: Value 'member' is unsubscriptable (unsubscriptable-object) tools/net/ynl/pyynl/ynl_gen_c.py:210:25: E1136: Value 'member' is unsubscriptable (unsubscriptable-object) tools/net/ynl/pyynl/ynl_gen_c.py:254:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:256:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:281:25: W0613: Unused argument 'space' (unused-argument) tools/net/ynl/pyynl/ynl_gen_c.py:428:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) tools/net/ynl/pyynl/ynl_gen_c.py:568:15: E0606: Possibly using variable 'mem' before assignment (possibly-used-before-assignment) tools/net/ynl/pyynl/ynl_gen_c.py:725:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) tools/net/ynl/pyynl/ynl_gen_c.py:812:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) tools/net/ynl/pyynl/ynl_gen_c.py:834:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) tools/net/ynl/pyynl/ynl_gen_c.py:940:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) tools/net/ynl/pyynl/ynl_gen_c.py:1001:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1033:12: W0612: Unused variable 'name' (unused-variable) tools/net/ynl/pyynl/ynl_gen_c.py:1046:33: W0621: Redefining name 'yaml' from outer scope (line 18) (redefined-outer-name) tools/net/ynl/pyynl/ynl_gen_c.py:1066:31: W0621: Redefining name 'yaml' from outer scope (line 18) (redefined-outer-name) tools/net/ynl/pyynl/ynl_gen_c.py:1093:14: R1728: Consider using a generator instead 'min(x.value for x in self.entries.values())' (consider-using-generator) tools/net/ynl/pyynl/ynl_gen_c.py:1094:15: R1728: Consider using a generator instead 'max(x.value for x in self.entries.values())' (consider-using-generator) tools/net/ynl/pyynl/ynl_gen_c.py:1103:31: W0621: Redefining name 'yaml' from outer scope (line 18) (redefined-outer-name) tools/net/ynl/pyynl/ynl_gen_c.py:1173:31: W0621: Redefining name 'yaml' from outer scope (line 18) (redefined-outer-name) tools/net/ynl/pyynl/ynl_gen_c.py:1208:31: W0621: Redefining name 'yaml' from outer scope (line 18) (redefined-outer-name) tools/net/ynl/pyynl/ynl_gen_c.py:1267:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1269:31: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1271:44: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1276:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1278:35: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1324:12: W0612: Unused variable 'op_name' (unused-variable) tools/net/ynl/pyynl/ynl_gen_c.py:1440:14: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) tools/net/ynl/pyynl/ynl_gen_c.py:1523:22: W0612: Unused variable 'struct' (unused-variable) tools/net/ynl/pyynl/ynl_gen_c.py:1543:12: W0612: Unused variable 'op_name' (unused-variable) tools/net/ynl/pyynl/ynl_gen_c.py:1276:8: W0201: Attribute 'root_sets' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1278:8: W0201: Attribute 'pure_nested_structs' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1289:8: W0201: Attribute 'kernel_policy' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1560:8: W0201: Attribute 'global_policy' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1561:8: W0201: Attribute 'global_policy_set' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1626:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1678:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) tools/net/ynl/pyynl/ynl_gen_c.py:1793:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:1813:12: R1731: Consider using 'longest = max(longest, len(define[0]))' instead of unnecessary if block (consider-using-max-builtin) tools/net/ynl/pyynl/ynl_gen_c.py:1819:15: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:1821:17: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:1826:18: R1728: Consider using a generator instead 'max(len(x[0]) for x in members)' (consider-using-generator) tools/net/ynl/pyynl/ynl_gen_c.py:2052:24: W0613: Unused argument 'family' (unused-argument) tools/net/ynl/pyynl/ynl_gen_c.py:2057:20: W0613: Unused argument 'family' (unused-argument) tools/net/ynl/pyynl/ynl_gen_c.py:2336:0: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements) tools/net/ynl/pyynl/ynl_gen_c.py:2668:8: R1714: Consider merging these comparisons with 'in' by using 'ri.op_mode in ('do', 'dump')'. Use a set instead if elements are hashable. (consider-using-in) tools/net/ynl/pyynl/ynl_gen_c.py:2681:9: R1714: Consider merging these comparisons with 'in' by using 'ri.op_mode in ('notify', 'event')'. Use a set instead if elements are hashable. (consider-using-in) tools/net/ynl/pyynl/ynl_gen_c.py:2944:7: R1714: Consider merging these comparisons with 'in' by using 'family.kernel_policy in ('global', 'per-op')'. Use a set instead if elements are hashable. (consider-using-in) tools/net/ynl/pyynl/ynl_gen_c.py:3360:12: W0612: Unused variable 'op_name' (unused-variable) tools/net/ynl/pyynl/ynl_gen_c.py:3435:8: W0101: Unreachable code (unreachable) tools/net/ynl/pyynl/ynl_gen_c.py:3538:20: W0612: Unused variable 'op_name' (unused-variable) ------------------------------------------------------------------ Your code has been rated at 9.74/10 (previous run: 9.74/10, +0.00) ====== Checking the tree with the patch ====== ************* Module pyynl.ynl_gen_c tools/net/ynl/pyynl/ynl_gen_c.py:3441:0: C0325: Unnecessary parens after '=' keyword (superfluous-parens) tools/net/ynl/pyynl/ynl_gen_c.py:888:0: R1707: Disallow trailing comma tuple (trailing-comma-tuple) tools/net/ynl/pyynl/ynl_gen_c.py:204:25: E1136: Value 'member' is unsubscriptable (unsubscriptable-object) tools/net/ynl/pyynl/ynl_gen_c.py:217:25: E1136: Value 'member' is unsubscriptable (unsubscriptable-object) tools/net/ynl/pyynl/ynl_gen_c.py:261:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:263:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:575:15: E0606: Possibly using variable 'mem' before assignment (possibly-used-before-assignment) tools/net/ynl/pyynl/ynl_gen_c.py:944:21: C0209: Formatting a regular string which could be an f-string (consider-using-f-string) tools/net/ynl/pyynl/ynl_gen_c.py:1005:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1097:14: R1728: Consider using a generator instead 'min(x.value for x in self.entries.values())' (consider-using-generator) tools/net/ynl/pyynl/ynl_gen_c.py:1098:15: R1728: Consider using a generator instead 'max(x.value for x in self.entries.values())' (consider-using-generator) tools/net/ynl/pyynl/ynl_gen_c.py:1271:21: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1273:31: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1275:44: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1280:25: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1282:35: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1444:14: C1802: Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty (use-implicit-booleaness-not-len) tools/net/ynl/pyynl/ynl_gen_c.py:1280:8: W0201: Attribute 'root_sets' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1282:8: W0201: Attribute 'pure_nested_structs' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1293:8: W0201: Attribute 'kernel_policy' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1564:8: W0201: Attribute 'global_policy' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1565:8: W0201: Attribute 'global_policy_set' defined outside __init__ (attribute-defined-outside-init) tools/net/ynl/pyynl/ynl_gen_c.py:1630:22: R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal) tools/net/ynl/pyynl/ynl_gen_c.py:1682:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding) tools/net/ynl/pyynl/ynl_gen_c.py:1797:11: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:1817:12: R1731: Consider using 'longest = max(longest, len(define[0]))' instead of unnecessary if block (consider-using-max-builtin) tools/net/ynl/pyynl/ynl_gen_c.py:1823:15: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:1825:17: C0123: Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck) tools/net/ynl/pyynl/ynl_gen_c.py:1830:18: R1728: Consider using a generator instead 'max(len(x[0]) for x in members)' (consider-using-generator) tools/net/ynl/pyynl/ynl_gen_c.py:2673:8: R1714: Consider merging these comparisons with 'in' by using 'ri.op_mode in ('do', 'dump')'. Use a set instead if elements are hashable. (consider-using-in) tools/net/ynl/pyynl/ynl_gen_c.py:2686:9: R1714: Consider merging these comparisons with 'in' by using 'ri.op_mode in ('notify', 'event')'. Use a set instead if elements are hashable. (consider-using-in) tools/net/ynl/pyynl/ynl_gen_c.py:2949:7: R1714: Consider merging these comparisons with 'in' by using 'family.kernel_policy in ('global', 'per-op')'. Use a set instead if elements are hashable. (consider-using-in) ------------------------------------------------------------------ Your code has been rated at 9.84/10 (previous run: 9.74/10, +0.10)