diff mbox

[2/2] checkpatch: use codespell for odp

Message ID 1431953356-10242-3-git-send-email-maxim.uvarov@linaro.org
State New
Headers show

Commit Message

Maxim Uvarov May 18, 2015, 12:49 p.m. UTC
checkpatch: use codespell for odp

By default configure is looking for codespell installed.
That check can be optionally turned off. Code spell can be
used directly from command line or be used for checkpatch.
For now it finds bunch of spelling issues:

./configure.ac:52: archetecture  ==> architecture
./m4/ax_prog_doxygen.m4:24: seperate  ==> separate
./m4/ax_prog_doxygen.m4:464: Seperate  ==> Separate
./m4/ax_prog_doxygen.m4:465: seperate  ==> separate
./doc/api_guide_lines.dox:93: addtion  ==> addition
./doc/api_guide_lines.dox:153: begining  ==> beginning
./scripts/checkpatch.pl:5262: preceeded  ==> preceded
./platform/linux-generic/odp_timer.c:601: occurence  ==> occurrence
./platform/linux-generic/odp_rwlock.c:52: aquired  ==> acquired
./platform/linux-generic/odp_pool.c:164: paramters  ==> parameters
./helper/ring.c:283: preceeded  ==> preceded
./helper/include/odp/helper/ip.h:157: extention  ==> extension
./example/ipsec/odp_ipsec_sa_db.h:17: Assocation  ==> Association
./example/ipsec/odp_ipsec_sa_db.h:32: Assocation  ==> Association
./example/generator/odp_generator.c:537: funtion  ==> function
./include/odp/api/queue.h:44: lenght  ==> length
./include/odp/api/queue.h:216: responsability  ==> responsibility
./include/odp/api/init.h:158: dependant  ==> dependent
./include/odp/api/crypto.h:113: paramters  ==> parameters
./include/odp/api/crypto.h:136: peformed  ==> performed
./include/odp/api/packet_io.h:67: becuase  ==> because
./include/odp/api/pool.h:40: lenght  ==> length
./test/validation/odp_cpumask.c:126: occured  ==> occurred
./test/performance/odp_atomic.c:47: excercise  ==> exercise

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 .checkpatch.conf |  1 +
 configure.ac     | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

Comments

Anders Roxell May 28, 2015, 8:20 p.m. UTC | #1
On 2015-05-18 15:49, Maxim Uvarov wrote:
> checkpatch: use codespell for odp

Remove.

> 
> By default configure is looking for codespell installed.
> That check can be optionally turned off. Code spell can be
> used directly from command line or be used for checkpatch.
> For now it finds bunch of spelling issues:
> 
> ./configure.ac:52: archetecture  ==> architecture
> ./m4/ax_prog_doxygen.m4:24: seperate  ==> separate
> ./m4/ax_prog_doxygen.m4:464: Seperate  ==> Separate
> ./m4/ax_prog_doxygen.m4:465: seperate  ==> separate
> ./doc/api_guide_lines.dox:93: addtion  ==> addition
> ./doc/api_guide_lines.dox:153: begining  ==> beginning
> ./scripts/checkpatch.pl:5262: preceeded  ==> preceded
> ./platform/linux-generic/odp_timer.c:601: occurence  ==> occurrence
> ./platform/linux-generic/odp_rwlock.c:52: aquired  ==> acquired
> ./platform/linux-generic/odp_pool.c:164: paramters  ==> parameters
> ./helper/ring.c:283: preceeded  ==> preceded
> ./helper/include/odp/helper/ip.h:157: extention  ==> extension
> ./example/ipsec/odp_ipsec_sa_db.h:17: Assocation  ==> Association
> ./example/ipsec/odp_ipsec_sa_db.h:32: Assocation  ==> Association
> ./example/generator/odp_generator.c:537: funtion  ==> function
> ./include/odp/api/queue.h:44: lenght  ==> length
> ./include/odp/api/queue.h:216: responsability  ==> responsibility
> ./include/odp/api/init.h:158: dependant  ==> dependent
> ./include/odp/api/crypto.h:113: paramters  ==> parameters
> ./include/odp/api/crypto.h:136: peformed  ==> performed
> ./include/odp/api/packet_io.h:67: becuase  ==> because
> ./include/odp/api/pool.h:40: lenght  ==> length
> ./test/validation/odp_cpumask.c:126: occured  ==> occurred
> ./test/performance/odp_atomic.c:47: excercise  ==> exercise

Maybe make the example list a bit shorter.

> 
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> ---
>  .checkpatch.conf |  1 +
>  configure.ac     | 20 ++++++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/.checkpatch.conf b/.checkpatch.conf
> index 9076410..17fcea6 100644
> --- a/.checkpatch.conf
> +++ b/.checkpatch.conf
> @@ -2,3 +2,4 @@
>  --strict
>  --ignore=NEW_TYPEDEFS
>  --ignore=DEPRECATED_VARIABLE
> +--codespell
> diff --git a/configure.ac b/configure.ac
> index d20bad2..73bb97f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -248,6 +248,26 @@ AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
>  AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [],
>               [AC_MSG_ERROR([OpenSSL headers required])])
>  
> +
> +##########################################################################
> +# Check for Codespell tool
> +##########################################################################
> +AC_CHECK_PROG([CODESPELL], [codespell], [codespell])
> +codespell_disabled=no
> +AC_ARG_ENABLE([codespell],
> +    [AS_HELP_STRING([--disable-codespell], [Use codespell for checkpatch.])],
> +    [case "$withval" in
> +     no)  ;;
> +     yes) codespell_disabled=yes ;;
> +     *)   AC_MSG_ERROR([Bad value ${withval} for --disable-codespell.]) ;;
> +     esac])
> +
> +if test $codespell_disabled == "no" && test -z $CODESPELL
> +then
> +    AC_MSG_ERROR([Codespell not found. apt-get install codespell or
> +                  use --disable-codespell])
> +fi
> +

I don't think it belongs in configure.ac at all.
Because configure is for configuring and building the code, whilst checkpatch is
for checking patches and has nothing to do with the software.

Cheers,
Anders
diff mbox

Patch

diff --git a/.checkpatch.conf b/.checkpatch.conf
index 9076410..17fcea6 100644
--- a/.checkpatch.conf
+++ b/.checkpatch.conf
@@ -2,3 +2,4 @@ 
 --strict
 --ignore=NEW_TYPEDEFS
 --ignore=DEPRECATED_VARIABLE
+--codespell
diff --git a/configure.ac b/configure.ac
index d20bad2..73bb97f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,6 +248,26 @@  AC_CHECK_LIB([crypto], [EVP_EncryptInit], [],
 AC_CHECK_HEADERS([openssl/des.h openssl/rand.h openssl/hmac.h openssl/evp.h], [],
              [AC_MSG_ERROR([OpenSSL headers required])])
 
+
+##########################################################################
+# Check for Codespell tool
+##########################################################################
+AC_CHECK_PROG([CODESPELL], [codespell], [codespell])
+codespell_disabled=no
+AC_ARG_ENABLE([codespell],
+    [AS_HELP_STRING([--disable-codespell], [Use codespell for checkpatch.])],
+    [case "$withval" in
+     no)  ;;
+     yes) codespell_disabled=yes ;;
+     *)   AC_MSG_ERROR([Bad value ${withval} for --disable-codespell.]) ;;
+     esac])
+
+if test $codespell_disabled == "no" && test -z $CODESPELL
+then
+    AC_MSG_ERROR([Codespell not found. apt-get install codespell or
+                  use --disable-codespell])
+fi
+
 ##########################################################################
 # Restore old saved variables
 ##########################################################################