sumpfralle opened a new pull request, #16302:
URL: https://github.com/apache/nuttx/pull/16302

   ## Summary
   
   These commits add a `.codespellrc` configuration file with suitable defaults 
and comments for all relevant use-cases in nuttx.
   
   Additionally the github workflow "check" is extended to run the codespell 
check on changed files.
   The log message of the check refers to the `.codespellrc` file in order to 
help people skip valid false positives.
   
   At the moment, 1990 out of 25838 files in the `nuttx` repository are 
reported by codespell as containing errors. I already prepared two pull 
requests, which will reduce the number of reported files to 630. In case I can 
keep the mood up, I may grind this number down to zero in the next days.
   
   
   ## Impact
   
   ### CI
   CI tests will start to fail, if a file contains a spelling problem (as 
detected by codespell).
   
   In case of a problem the PR submitter will:
   1. Notice the failed CI workflow "check".
   1. Take a look at that CI job log.
   1. In case of a real spelling mistake:
       1. Fix the issue and update the PR.
   1. In case of a misdetected spelling issue:
       1. Notice the reference to the file `.codespellrc` in the CI log.
       1. Take a look at the file `.codespellrc` and hopefully understands 
easily, which approach would be suitable for this issue (exclude the word, line 
or file).
   
   ### pre-commit
   
   The `pre-commit` check displays spelling problems in changed files.
   The configuration file (`.codespellrc`) is mentioned. 
   
   ## Testing
   
   ### CI
   I did not test the CI workflow for now. This PR will be the first example.
   
   ### pre-commit
   The pre-commit hook now detects spelling problems in changed files:
   ```
   $ git diff HEAD~..HEAD
   diff --git a/CMakeLists.txt b/CMakeLists.txt
   index 0402b282d3..065b3494b8 100644
   --- a/CMakeLists.txt
   +++ b/CMakeLists.txt
   @@ -1,3 +1,4 @@
   +# foo
    # 
##############################################################################
    # CMakeLists.txt
    #
   $ pre-commit run --from HEAD~ --to HEAD
   fix end of 
files.........................................................Passed
   trim trailing 
whitespace.................................................Passed
   check for added large 
files..............................................Passed
   
cmake-format.............................................................Passed
   
nxstyle..................................................................Failed
   - hook id: nxstyle
   - exit code: 1
   
   Used config files:
       1: .codespellrc
   CMakeLists.txt:162: inital ==> initial
   CMakeLists.txt:271: platfrom ==> platform
   CMakeLists.txt:318: Unsupport ==> Unsupported
   CMakeLists.txt:385: extenstion ==> extension
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to