| 9b6b016d | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: fix logic errors reported by pylint
Fix the following logic errors:
tools/net/ynl/pyynl/lib/nlspec.py:299:15: E1101: Instance of 'list' has no 'items' member (no-member)
tools/net/ynl/
tools: ynl: fix logic errors reported by pylint
Fix the following logic errors:
tools/net/ynl/pyynl/lib/nlspec.py:299:15: E1101: Instance of 'list' has no 'items' member (no-member)
tools/net/ynl/pyynl/lib/nlspec.py:580:22: E0606: Possibly using variable 'op' before assignment (possibly-used-before-assignment)
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-8-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 00ef9f15 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: fix pylint global variable related warnings
Refactor to avoid using global variables to fix the following pylint issues:
- invalid-name - global-statement - global-variable-not-assigned
tools: ynl: fix pylint global variable related warnings
Refactor to avoid using global variables to fix the following pylint issues:
- invalid-name - global-statement - global-variable-not-assigned
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-7-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 542ba2de | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: fix pylint misc warnings
Fix pylint warnings for:
- unused-argument - consider-using-in - consider-using-get - consider-using-f-string - protected-access - unidiomatic-typecheck - no-el
tools: ynl: fix pylint misc warnings
Fix pylint warnings for:
- unused-argument - consider-using-in - consider-using-get - consider-using-f-string - protected-access - unidiomatic-typecheck - no-else-return
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-6-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 04b0b64e | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: fix pylint dict, indentation, long lines, uninitialised
Fix pylint warnings for:
- use-dict-literal - bad-indentation - line-too-long - possibly-used-before-assignment
Signed-off-by: D
tools: ynl: fix pylint dict, indentation, long lines, uninitialised
Fix pylint warnings for:
- use-dict-literal - bad-indentation - line-too-long - possibly-used-before-assignment
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-5-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| b6270a10 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: fix pylint exception warnings
Fix pylint warnings for:
- broad-exception-raised - broad-exception-caught - raise-missing-from
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Lin
tools: ynl: fix pylint exception warnings
Fix pylint warnings for:
- broad-exception-raised - broad-exception-caught - raise-missing-from
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-4-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| bcdd8ea7 | 08-Jan-2026 |
Donald Hunter <donald.hunter@gmail.com> |
tools: ynl: fix pylint redefinition, encoding errors
Fix pylint warnings for:
- invalid-name - arguments-renamed - redefined-outer-name - unspecified-encoding - consider-using-sys-exit
Signed-off-
tools: ynl: fix pylint redefinition, encoding errors
Fix pylint warnings for:
- invalid-name - arguments-renamed - redefined-outer-name - unspecified-encoding - consider-using-sys-exit
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20260108161339.29166-3-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 34164142 | 27-Oct-2025 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: rework the string representation of NlError
In early days of YNL development dumping the NlMsg on errors was quite useful, as the library itself could have been buggy. These days increas
tools: ynl: rework the string representation of NlError
In early days of YNL development dumping the NlMsg on errors was quite useful, as the library itself could have been buggy. These days increasingly the NlMsg is just taking up screen space and means nothing to a typical user. Try to format the errors more in line with how YNL C formats its errors strings.
Before: $ ynl --family ethtool --do channels-set --json '{}' Netlink error: Invalid argument nl_len = 44 (28) nl_flags = 0x300 nl_type = 2 error: -22 extack: {'miss-type': 'header'}
$ ynl --family ethtool --do channels-set --json '{..., "tx-count": 999}' Netlink error: Invalid argument nl_len = 88 (72) nl_flags = 0x300 nl_type = 2 error: -22 extack: {'msg': 'requested channel count exceeds maximum', 'bad-attr': '.tx-count'}
After: $ ynl --family ethtool --do channels-set --json '{}' Netlink error: Invalid argument {'miss-type': 'header'}
$ ynl --family ethtool --do channels-set --json '{..., "tx-count": 999}' Netlink error: requested channel count exceeds maximum: Invalid argument {'bad-attr': '.tx-count'}
Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20251027192958.2058340-2-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 1b255e1b | 15-Sep-2025 |
Asbjørn Sloth Tønnesen <ast@fiberby.net> |
tools: ynl: add ipv4-or-v6 display hint
The attribute WGALLOWEDIP_A_IPADDR can contain either an IPv4 or an IPv6 address depending on WGALLOWEDIP_A_FAMILY, however in practice it is enough to look a
tools: ynl: add ipv4-or-v6 display hint
The attribute WGALLOWEDIP_A_IPADDR can contain either an IPv4 or an IPv6 address depending on WGALLOWEDIP_A_FAMILY, however in practice it is enough to look at the attribute length.
This patch implements an ipv4-or-v6 display hint, that can deal with this kind of attribute.
It only implements this display hint for genetlink-legacy, it can be added to other protocol variants if needed, but we don't want to encourage it's use.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250915144301.725949-12-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 52550d51 | 15-Sep-2025 |
Asbjørn Sloth Tønnesen <ast@fiberby.net> |
tools: ynl: decode hex input
This patch adds support for decoding hex input, so that binary attributes can be read through --json.
Example (using future wireguard.yaml): $ sudo ./tools/net/ynl/pyy
tools: ynl: decode hex input
This patch adds support for decoding hex input, so that binary attributes can be read through --json.
Example (using future wireguard.yaml): $ sudo ./tools/net/ynl/pyynl/cli.py --family wireguard \ --do set-device --json '{"ifindex":3, "private-key":"2a ae 6c 35 c9 4f cf <... to 32 bytes>"}'
In order to somewhat mirror what is done in _formatted_string(), then for non-binary attributes attempt to convert it to an int.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250915144301.725949-11-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 5c51ae24 | 15-Sep-2025 |
Asbjørn Sloth Tønnesen <ast@fiberby.net> |
tools: ynl: encode indexed-arrays
This patch adds support for encoding indexed-array attributes with sub-type nest in pyynl.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Don
tools: ynl: encode indexed-arrays
This patch adds support for encoding indexed-array attributes with sub-type nest in pyynl.
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250915144301.725949-10-ast@fiberby.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 10d32b0d | 09-Sep-2025 |
Matthieu Baerts (NGI0) <matttbe@kernel.org> |
tools: ynl: use 'cond is None'
It is better to use the 'is' keyword instead of comparing to None according to Ruff.
This is linked to Ruff error E711 [1]:
According to PEP 8, "Comparisons to sin
tools: ynl: use 'cond is None'
It is better to use the 'is' keyword instead of comparing to None according to Ruff.
This is linked to Ruff error E711 [1]:
According to PEP 8, "Comparisons to singletons like None should always be done with is or is not, never the equality operators."
Link: https://docs.astral.sh/ruff/rules/none-comparison/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-7-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 616129d6 | 09-Sep-2025 |
Matthieu Baerts (NGI0) <matttbe@kernel.org> |
tools: ynl: remove unnecessary semicolons
These semicolons are not required according to Ruff. Simply remove them.
This is linked to Ruff error E703 [1]:
A trailing semicolon is unnecessary and
tools: ynl: remove unnecessary semicolons
These semicolons are not required according to Ruff. Simply remove them.
This is linked to Ruff error E703 [1]:
A trailing semicolon is unnecessary and should be removed.
Link: https://docs.astral.sh/ruff/rules/useless-semicolon/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-6-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 389712b0 | 09-Sep-2025 |
Matthieu Baerts (NGI0) <matttbe@kernel.org> |
tools: ynl: remove unused imports
These imports are not used according to Ruff, and can be safely removed.
This is linked to Ruff error F401 [1]:
Unused imports add a performance overhead at run
tools: ynl: remove unused imports
These imports are not used according to Ruff, and can be safely removed.
This is linked to Ruff error F401 [1]:
Unused imports add a performance overhead at runtime, and risk creating import cycles. They also increase the cognitive load of reading the code.
There is one exception with 'YnlDocGenerator' which is added in __all__: it is used by ynl_gen_rst.py.
Link: https://docs.astral.sh/ruff/rules/unused-import/ [1] Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Asbjørn Sloth Tønnesen <ast@fiberby.net> Link: https://patch.msgid.link/20250909-net-next-ynl-ruff-v1-5-238c2bccdd99@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
| 0b24dfdd | 17-Jun-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
docs: parser_yaml.py: add support for line numbers from the parser
Instead of printing line numbers from the temp converted ReST file, get them from the original source.
Signed-off-by: Mauro Carval
docs: parser_yaml.py: add support for line numbers from the parser
Instead of printing line numbers from the temp converted ReST file, get them from the original source.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
| ad06a878 | 17-Jun-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
tools: netlink_yml_parser.py: add line numbers to parsed data
When something goes wrong, we want Sphinx error to point to the right line number from the original source, not from the processed ReST
tools: netlink_yml_parser.py: add line numbers to parsed data
When something goes wrong, we want Sphinx error to point to the right line number from the original source, not from the processed ReST data.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
| 3a3b8a14 | 13-Jun-2025 |
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
tools: ynl_gen_rst.py: cleanup coding style
Cleanup some coding style issues pointed by pylint and flake8.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> R
tools: ynl_gen_rst.py: cleanup coding style
Cleanup some coding style issues pointed by pylint and flake8.
No functional changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Reviewed-by: Breno Leitao <leitao@debian.org> Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
show more ...
|