DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] devtools: fix false positive from checkpatch
@ 2024-09-17 15:34 Stephen Hemminger
  2024-09-17 15:45 ` Bruce Richardson
  2024-09-17 16:56 ` [PATCH v2] " Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2024-09-17 15:34 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon

The codespell dictionary has "stdio" in its bad word list,
but stdio.h is often used in DPDK code and creates bogus false
postitives from checkpatch.

Also add a check to the parameters to build-dict.sh so it
gives usage error if parameter is missing or does not point
to the codespell git clone.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 devtools/build-dict.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/devtools/build-dict.sh b/devtools/build-dict.sh
index a8cac49029..96786d2c53 100755
--- a/devtools/build-dict.sh
+++ b/devtools/build-dict.sh
@@ -6,6 +6,10 @@
 
 # path to local clone of https://github.com/codespell-project/codespell.git
 codespell_path=$1
+if [ ! -d "$codespell_path/codespell_lib/data" ]; then
+	echo "Usage: $0 <path_to_codespell_project>"
+	exit 1
+fi
 
 # concatenate codespell dictionaries, except GB/US one
 for suffix in .txt _code.txt _informal.txt _names.txt _rare.txt _usage.txt ; do
@@ -17,6 +21,7 @@ sed '/^..->/d' |
 sed '/^uint->/d' |
 sed "/^doesn'->/d" |
 sed '/^wasn->/d' |
+sed '/stdio->/d' |
 
 # print to stdout
 cat
-- 
2.45.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] devtools: fix false positive from checkpatch
  2024-09-17 15:34 [PATCH] devtools: fix false positive from checkpatch Stephen Hemminger
@ 2024-09-17 15:45 ` Bruce Richardson
  2024-09-17 15:49   ` Thomas Monjalon
  2024-09-17 16:54   ` Stephen Hemminger
  2024-09-17 16:56 ` [PATCH v2] " Stephen Hemminger
  1 sibling, 2 replies; 5+ messages in thread
From: Bruce Richardson @ 2024-09-17 15:45 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, Thomas Monjalon

On Tue, Sep 17, 2024 at 08:34:21AM -0700, Stephen Hemminger wrote:
> The codespell dictionary has "stdio" in its bad word list,
> but stdio.h is often used in DPDK code and creates bogus false
> postitives from checkpatch.
> 
> Also add a check to the parameters to build-dict.sh so it
> gives usage error if parameter is missing or does not point
> to the codespell git clone.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  devtools/build-dict.sh | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/devtools/build-dict.sh b/devtools/build-dict.sh
> index a8cac49029..96786d2c53 100755
> --- a/devtools/build-dict.sh
> +++ b/devtools/build-dict.sh
> @@ -6,6 +6,10 @@
>  
>  # path to local clone of https://github.com/codespell-project/codespell.git
>  codespell_path=$1
> +if [ ! -d "$codespell_path/codespell_lib/data" ]; then
> +	echo "Usage: $0 <path_to_codespell_project>"
> +	exit 1
> +fi
>  
>  # concatenate codespell dictionaries, except GB/US one
>  for suffix in .txt _code.txt _informal.txt _names.txt _rare.txt _usage.txt ; do
> @@ -17,6 +21,7 @@ sed '/^..->/d' |
>  sed '/^uint->/d' |
>  sed "/^doesn'->/d" |
>  sed '/^wasn->/d' |
> +sed '/stdio->/d' |
>  
Seems a good idea. However, why use "stdio" alone rather than using the
full "stdio.h" header name. Do we expect "stdio" to be used much in
comments or otherwise?

/Bruce

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] devtools: fix false positive from checkpatch
  2024-09-17 15:45 ` Bruce Richardson
@ 2024-09-17 15:49   ` Thomas Monjalon
  2024-09-17 16:54   ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2024-09-17 15:49 UTC (permalink / raw)
  To: Stephen Hemminger, Bruce Richardson; +Cc: dev

17/09/2024 17:45, Bruce Richardson:
> On Tue, Sep 17, 2024 at 08:34:21AM -0700, Stephen Hemminger wrote:
> > The codespell dictionary has "stdio" in its bad word list,
> > but stdio.h is often used in DPDK code and creates bogus false
> > postitives from checkpatch.
> > 
> > Also add a check to the parameters to build-dict.sh so it
> > gives usage error if parameter is missing or does not point
> > to the codespell git clone.
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> >  devtools/build-dict.sh | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/devtools/build-dict.sh b/devtools/build-dict.sh
> > index a8cac49029..96786d2c53 100755
> > --- a/devtools/build-dict.sh
> > +++ b/devtools/build-dict.sh
> > @@ -6,6 +6,10 @@
> >  
> >  # path to local clone of https://github.com/codespell-project/codespell.git
> >  codespell_path=$1
> > +if [ ! -d "$codespell_path/codespell_lib/data" ]; then
> > +	echo "Usage: $0 <path_to_codespell_project>"
> > +	exit 1
> > +fi
> >  
> >  # concatenate codespell dictionaries, except GB/US one
> >  for suffix in .txt _code.txt _informal.txt _names.txt _rare.txt _usage.txt ; do
> > @@ -17,6 +21,7 @@ sed '/^..->/d' |
> >  sed '/^uint->/d' |
> >  sed "/^doesn'->/d" |
> >  sed '/^wasn->/d' |
> > +sed '/stdio->/d' |
> >  
> Seems a good idea. However, why use "stdio" alone rather than using the
> full "stdio.h" header name. Do we expect "stdio" to be used much in
> comments or otherwise?

The dictionary doesn't know stdio.h

You could start with a caret to mimic other entries.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] devtools: fix false positive from checkpatch
  2024-09-17 15:45 ` Bruce Richardson
  2024-09-17 15:49   ` Thomas Monjalon
@ 2024-09-17 16:54   ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2024-09-17 16:54 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Thomas Monjalon

On Tue, 17 Sep 2024 16:45:35 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> >  # concatenate codespell dictionaries, except GB/US one
> >  for suffix in .txt _code.txt _informal.txt _names.txt _rare.txt _usage.txt ; do
> > @@ -17,6 +21,7 @@ sed '/^..->/d' |
> >  sed '/^uint->/d' |
> >  sed "/^doesn'->/d" |
> >  sed '/^wasn->/d' |
> > +sed '/stdio->/d' |
> >    
> Seems a good idea. However, why use "stdio" alone rather than using the
> full "stdio.h" header name. Do we expect "stdio" to be used much in
> comments or otherwise?
> 
> /Bruce

This script removes entries from the codespell dictionary.
So we are removing this line:
	stdio->studio
Which causes:
WARNING:TYPO_SPELLING: 'stdio' may be misspelled - perhaps 'studio'?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] devtools: fix false positive from checkpatch
  2024-09-17 15:34 [PATCH] devtools: fix false positive from checkpatch Stephen Hemminger
  2024-09-17 15:45 ` Bruce Richardson
@ 2024-09-17 16:56 ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Hemminger @ 2024-09-17 16:56 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon

The codespell dictionary has "stdio" in its bad word list,
but stdio.h is often used in DPDK code and creates bogus false
positives from checkpatch.

Also add a check to the parameters to build-dict.sh so it
gives usage error if parameter is missing or does not point
to the codespell git clone.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 devtools/build-dict.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/devtools/build-dict.sh b/devtools/build-dict.sh
index a8cac49029..f2fedd534a 100755
--- a/devtools/build-dict.sh
+++ b/devtools/build-dict.sh
@@ -6,6 +6,10 @@
 
 # path to local clone of https://github.com/codespell-project/codespell.git
 codespell_path=$1
+if [ ! -d "$codespell_path/codespell_lib/data" ]; then
+	echo "Usage: $0 <path_to_codespell_project>"
+	exit 1
+fi
 
 # concatenate codespell dictionaries, except GB/US one
 for suffix in .txt _code.txt _informal.txt _names.txt _rare.txt _usage.txt ; do
@@ -17,6 +21,7 @@ sed '/^..->/d' |
 sed '/^uint->/d' |
 sed "/^doesn'->/d" |
 sed '/^wasn->/d' |
+sed '/^stdio->/d' |
 
 # print to stdout
 cat
-- 
2.45.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-17 16:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-17 15:34 [PATCH] devtools: fix false positive from checkpatch Stephen Hemminger
2024-09-17 15:45 ` Bruce Richardson
2024-09-17 15:49   ` Thomas Monjalon
2024-09-17 16:54   ` Stephen Hemminger
2024-09-17 16:56 ` [PATCH v2] " Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).