diff mbox series

[net-next] tools: ynl: don't append doc of missing type directly to the type

Message ID 20240426003111.359285-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit 5c4c0edca68a5841a8d53ccd49596fe199c8334c
Delegated to: Netdev Maintainers
Headers show
Series [net-next] tools: ynl: don't append doc of missing type directly to the type | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-26--09-00 (tests: 993)

Commit Message

Jakub Kicinski April 26, 2024, 12:31 a.m. UTC
When using YNL in tests appending the doc string to the type
name makes it harder to check that we got the correct error.
Put the doc under a separate key.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/net/ynl/lib/ynl.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Donald Hunter April 26, 2024, 3:25 p.m. UTC | #1
Jakub Kicinski <kuba@kernel.org> writes:

> When using YNL in tests appending the doc string to the type
> name makes it harder to check that we got the correct error.
> Put the doc under a separate key.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

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

> ---
>  tools/net/ynl/lib/ynl.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
> index 35f82a2c2247..35e666928119 100644
> --- a/tools/net/ynl/lib/ynl.py
> +++ b/tools/net/ynl/lib/ynl.py
> @@ -233,10 +233,9 @@ from .nlspec import SpecFamily
>                      miss_type = self.extack['miss-type']
>                      if miss_type in attr_space.attrs_by_val:
>                          spec = attr_space.attrs_by_val[miss_type]
> -                        desc = spec['name']
> +                        self.extack['miss-type'] = spec['name']
>                          if 'doc' in spec:
> -                            desc += f" ({spec['doc']})"
> -                        self.extack['miss-type'] = desc
> +                            self.extack['miss-type-doc'] = spec['doc']
>  
>      def _decode_policy(self, raw):
>          policy = {}
patchwork-bot+netdevbpf@kernel.org April 27, 2024, 12:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 25 Apr 2024 17:31:11 -0700 you wrote:
> When using YNL in tests appending the doc string to the type
> name makes it harder to check that we got the correct error.
> Put the doc under a separate key.
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  tools/net/ynl/lib/ynl.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Here is the summary with links:
  - [net-next] tools: ynl: don't append doc of missing type directly to the type
    https://git.kernel.org/netdev/net-next/c/5c4c0edca68a

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
index 35f82a2c2247..35e666928119 100644
--- a/tools/net/ynl/lib/ynl.py
+++ b/tools/net/ynl/lib/ynl.py
@@ -233,10 +233,9 @@  from .nlspec import SpecFamily
                     miss_type = self.extack['miss-type']
                     if miss_type in attr_space.attrs_by_val:
                         spec = attr_space.attrs_by_val[miss_type]
-                        desc = spec['name']
+                        self.extack['miss-type'] = spec['name']
                         if 'doc' in spec:
-                            desc += f" ({spec['doc']})"
-                        self.extack['miss-type'] = desc
+                            self.extack['miss-type-doc'] = spec['doc']
 
     def _decode_policy(self, raw):
         policy = {}