1
0
mirror of https://github.com/FreeRTOS/coreMQTT synced 2025-05-28 12:05:52 +08:00
Nathan Glimsdale b591004ba5
Add formatting checks. (#30)
* Add formatting checks.

Co-authored-by: Sarena Meas <sarem@amazon.com>
Co-authored-by: Archit Aggarwal <architag@amazon.com>
2020-09-03 14:40:28 -07:00
..
2020-09-03 14:40:28 -07:00

Pre-requisites to running the spell check scripts

  1. In your GNU environment, install the spell and getopt programs. Use the following commands in Debian distributions, to install the packages (getopt is part of the util-linux package):

    apt-get install spell
    apt-get install util-linux
    
  2. Add the folder containing the tools/spell/ablexicon, tools/spell/extract-comments, and tools/spell/find-unknown-comment-words scripts to your system's PATH.

    export PATH=<REPO_ROOT>/tools/spell:$PATH
    

How to create a lexicon.txt for a new directory.

  1. Ensure there does not exist a file called "lexicon.txt" in the directory. Run the following command to create a lexicon.txt for the directory:

    find-unknown-comment-words -d <PATH>/<TO>/<DIRECTORY> > <PATH>/<TO>/<DIRECTORY>/lexicon.txt
    
  2. Check the contents of // for any misspelled words. Fix them in your library's source code and delete them from the lexicon.txt.

How to run for changes to an existing directory containing lexicon.txt file.

  1. If there exists a lexicon.txt in a directory, run the following command:

    find-unknown-comment-words -d <PATH>/<TO>/<DIRECTORY>
    
  2. Add any non-dictionary correctly spelled words to ///lexicon.txt. Fix any misspelled words in your code comment change.