Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider:

Critical: 0 · High: 0 · Medium: 1 · Low: 0 (1)

- [Medium] Commit message mischaracterizes the change: the subject and
  body claim the patch suppresses "complexity and structural warnings"…

Pre-existing issues:
- [Low] Latent inheritance-declaration inconsistency now permanently
  masked: `ovskey.ovs_key_ct_tuple_ipv6` is declared `class…

--

selftests: openvswitch: suppress pylint complexity warnings

This adds a block of module-level pylint disable directives to the top of
tools/testing/selftests/net/openvswitch/ovs-dpctl.py.  The commit message
describes them as complexity and structural suppressions matching the large
netlink message classes in the tool.

> diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py 
> b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
> index dc88cb1b20c1..7ea0d5204401 100644
> --- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
> +++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
> @@ -1,6 +1,14 @@
>  #!/usr/bin/env python3
>  # SPDX-License-Identifier: GPL-2.0
>  """OVS datapath control utility for kernel selftests."""
> +# pylint: disable=invalid-name,too-many-lines
> +# pylint: disable=too-many-ancestors,too-many-arguments
> +# pylint: disable=too-many-positional-arguments,too-many-branches
> +# pylint: disable=too-many-locals,too-many-statements
> +# pylint: disable=too-many-return-statements,too-many-nested-blocks
> +# pylint: disable=unused-argument,broad-exception-caught
> +# pylint: disable=no-member,not-callable

[Severity: Medium]
Does the commit message match what these lines actually do?  The subject says
"suppress pylint complexity warnings" and the body says the disables "cover
complexity and structural warnings", but only the too-many-* entries are
complexity checks.

no-member (E1101) and not-callable (E1102) are pylint error-category
diagnostics, and invalid-name (C0103), unused-argument (W0613),
broad-exception-caught (W0718), non-parent-init-called (W0233) and
super-init-not-called (W0231) are unrelated convention/warning checks.

Because these are module-scope directives they apply to the whole file
(roughly 3200 lines), so a misspelled attribute access or a call on a
non-callable anywhere in ovs-dpctl.py can no longer be reported.  This lands
alongside other patches that rewrite format strings and control flow in the
same file.

Could the message spell out that error-class checks are being turned off
file-wide, or could no-member/not-callable be narrowed to the specific
classes that need them?

Also, invalid-name is now disabled module-wide, which makes the pre-existing
inline suppression in ovsactions dead code:

    class dec_ttl(nla):  # pylint: disable=invalid-name

Should that inline disable be dropped in the same patch so there is only one
suppression scope in the file?

> +# pylint: disable=non-parent-init-called,super-init-not-called

[Severity: Low]
This isn't a bug introduced by this patch, but disabling
non-parent-init-called module-wide removes the only automated signal for an
existing inconsistency in ovskey.

ovskey.ovs_key_ct_tuple_ipv6 is declared with nla as its base:

    class ovs_key_ct_tuple_ipv6(nla):
        """IPv6 conntrack tuple key (OVS_KEY_ATTR_CT_TUPLE_IPV6)."""

but its __init__ initializes through a class that is not in its ancestry:

            ovskey.ovs_key_proto.__init__(
                self,
                "ct_tuple6",
                ...

Its ABI peer does derive from ovs_key_proto:

    class ovs_key_ct_tuple_ipv4(ovs_key_proto):

Nothing appears to misbehave today: ovs_key_proto.__init__ only sets
self.proto_str and forwards to nla.__init__, which is a real ancestor, and
neither ct_tuple4 nor ct_tuple6 appears in the ovskey.parse() or
ovskey.dpstr() dispatch tables, so the ovs_key_proto.parse()/dpstr() methods
that ovs_key_ct_tuple_ipv6 does not inherit are never called.

Would it be worth fixing the declared base class to ovs_key_proto rather
than silencing the check that flags it?

-- 
Sashiko AI review · 
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260908171859.1967327-1-houminxi%40gmail.com
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to