[PATCH net-next 0/8] tools: ynl: fix errors reported by Ruff

Matthieu Baerts (NGI0) posted 8 patches 3 weeks, 2 days ago
tools/net/ynl/pyynl/ethtool.py      | 14 ++++++--------
tools/net/ynl/pyynl/lib/__init__.py |  2 +-
tools/net/ynl/pyynl/lib/nlspec.py   |  2 +-
tools/net/ynl/pyynl/lib/ynl.py      |  7 +++----
tools/net/ynl/pyynl/ynl_gen_c.py    | 31 ++++++++++++++-----------------
5 files changed, 25 insertions(+), 31 deletions(-)
[PATCH net-next 0/8] tools: ynl: fix errors reported by Ruff
Posted by Matthieu Baerts (NGI0) 3 weeks, 2 days ago
When looking at the YNL code to add a new feature, my text editor
automatically executed 'ruff check', and found out at least one
interesting error: one variable was used while not being defined.

I then decided to fix this error, and all the other ones reported by
Ruff. After this series, 'ruff check' reports no more errors with
version 0.12.12.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (8):
      tools: ynl: fix undefined variable name
      tools: ynl: avoid bare except
      tools: ynl: remove assigned but never used variable
      tools: ynl: remove f-string without any placeholders
      tools: ynl: remove unused imports
      tools: ynl: remove unnecessary semicolons
      tools: ynl: use 'cond is None'
      tools: ynl: check for membership with 'not in'

 tools/net/ynl/pyynl/ethtool.py      | 14 ++++++--------
 tools/net/ynl/pyynl/lib/__init__.py |  2 +-
 tools/net/ynl/pyynl/lib/nlspec.py   |  2 +-
 tools/net/ynl/pyynl/lib/ynl.py      |  7 +++----
 tools/net/ynl/pyynl/ynl_gen_c.py    | 31 ++++++++++++++-----------------
 5 files changed, 25 insertions(+), 31 deletions(-)
---
base-commit: 3b4296f5893d3a4e19edfc3800cb79381095e55f
change-id: 20250909-net-next-ynl-ruff-60fd7b591cee

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>
Re: [PATCH net-next 0/8] tools: ynl: fix errors reported by Ruff
Posted by Asbjørn Sloth Tønnesen 3 weeks ago
On 9/9/25 9:07 PM, Matthieu Baerts (NGI0) wrote:
> When looking at the YNL code to add a new feature, my text editor
> automatically executed 'ruff check', and found out at least one
> interesting error: one variable was used while not being defined.
> 
> I then decided to fix this error, and all the other ones reported by
> Ruff. After this series, 'ruff check' reports no more errors with
> version 0.12.12.
> 
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> Matthieu Baerts (NGI0) (8):
>        tools: ynl: fix undefined variable name
>        tools: ynl: avoid bare except
>        tools: ynl: remove assigned but never used variable
>        tools: ynl: remove f-string without any placeholders
>        tools: ynl: remove unused imports
>        tools: ynl: remove unnecessary semicolons
>        tools: ynl: use 'cond is None'
>        tools: ynl: check for membership with 'not in'

LGTM. When I first saw this, I expected it to collide
with my v2, but I have checked, and they don't clash.

Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Re: [PATCH net-next 0/8] tools: ynl: fix errors reported by Ruff
Posted by Donald Hunter 3 weeks, 1 day ago
"Matthieu Baerts (NGI0)" <matttbe@kernel.org> writes:

> When looking at the YNL code to add a new feature, my text editor
> automatically executed 'ruff check', and found out at least one
> interesting error: one variable was used while not being defined.
>
> I then decided to fix this error, and all the other ones reported by
> Ruff. After this series, 'ruff check' reports no more errors with
> version 0.12.12.
>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> Matthieu Baerts (NGI0) (8):
>       tools: ynl: fix undefined variable name
>       tools: ynl: avoid bare except
>       tools: ynl: remove assigned but never used variable
>       tools: ynl: remove f-string without any placeholders
>       tools: ynl: remove unused imports
>       tools: ynl: remove unnecessary semicolons
>       tools: ynl: use 'cond is None'
>       tools: ynl: check for membership with 'not in'

The series looks good to me, thanks for the fixes.

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>