From a3f29f80403df630c5bd7a0fb2cfe90b10bba3f5 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Tue, 5 Sep 2023 16:05:22 -0700 Subject: [PATCH] Cleanup the readme, remove the rust spell check tests, update the clang-format tests a bit --- .gitattributes | 2 - .github/workflows/test.yml | 70 ++++--------------- .gitignore | 2 +- README.md | 34 ++++----- .../testWithFormattingError.c | 6 +- formatting/action.yml | 6 +- 6 files changed, 39 insertions(+), 81 deletions(-) diff --git a/.gitattributes b/.gitattributes index ed4092f0..0e228418 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,2 @@ formatting/filesWithCRLFEndings/* eol=crlf clang-formatting/filesWithCRLFEndings/* eol=crlf -clang-formatting/filesWithFormattingErrors/testWithFormattingError.c eol=crlf -clang-formatting/filesWithFormattingErrors/* eol=crlf diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ba4897f3..8ca8f6e8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,6 +15,20 @@ env: bashEnd: \033[0m jobs: + test-format-check: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + with: + repository: FreeRTOS/coreMQTT + path: coreMQTT + + - name: Test formatting check action + uses: ./formatting + with: + path: coreMQTT + exclude-dirs: build,docs test-complexity-check: runs-on: ubuntu-latest @@ -123,62 +137,6 @@ jobs: fi exit $exitStatus - test-rust-spell-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/checkout@v3 - with: - repository: FreeRTOS/coreMQTT - ref: main - path: coreMQTT - - - name: Test spell check action - uses: ./rust-spell-check - with: - path: coreMQTT - - - test-rust-spell-checker-find-mistake: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: actions/checkout@v3 - with: - repository: FreeRTOS/coreMQTT - ref: main - path: coreMQTT - - - name: Empty the lexicon - shell: bash - working-directory: coreMQTT - run: file=$(find . -name .cSpellWords.txt); readlink -f "$file" ; > "$file" - - - name: Test Spell Check Fails on Misspelled Word - continue-on-error: true - id: test-rust-spell-check-find-mistake - uses: ./rust-spell-check - with: - path: coreMQTT - - - env: - stepName: Check Failure Test Case - name: ${{ env.stepName }} - id: check-failure-test-cases - shell: bash - run: | - # ${{ env.stepName }} - exitStatus=0 - if [ "${{ steps.test-rust-spell-check-find-mistake.outcome}}" = "failure" ]; then - echo -e "${{ env.bashPass }} Functional | Failure | Fail on Misspelled Word | Had Expected "failure" ${{ env.bashEnd }}" - else - echo -e "${{ env.bashFail }} Functional | Failure | Fail on Misspelled Word | Had Unexpected "success" ${{ env.bashEnd }}" - exitStatus=1 - fi - exit $exitStatus - test-coverage-cop: runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index 8dd38c4e..3594ddef 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ demo_run_logs/ rust-spell-check/target/ rust-spell-check/debug/ # Ignore any helper scripts people are writing while working -*.sh \ No newline at end of file +*.sh diff --git a/README.md b/README.md index 8432ef0b..3b4ca5c4 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,13 @@ Repositories. This currently includes: FreeRTOS Repositories: - [FreeRTOS](https://github.com/FreeRTOS/FreeRTOS), +[FreeRTOS](https://github.com/FreeRTOS/FreeRTOS), [FreeRTOS-Kernel](https://github.com/FreeRTOS/FreeRTOS-Kernel), [FreeRTOS-Plus-TCP](https://github.com/FreeRTOS/FreeRTOS-Plus-TCP), and [FreeRTOS-Cellular-Interface](https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface), FreeRTOS-Library Repositories: - [backoffAlgorithm](https://github.com/FreeRTOS/backoffAlgorithm), +[backoffAlgorithm](https://github.com/FreeRTOS/backoffAlgorithm), [coreHTTP](https://github.com/FreeRTOS/coreHTTP), [coreJSON](https://github.com/FreeRTOS/coreJSON), [coreMQTT](https://github.com/FreeRTOS/coreMQTT) @@ -22,7 +22,7 @@ FreeRTOS-Library Repositories: and [coreSNTP](https://github.com/FreeRTOS/coreSNTP), AWS-Library Repositories: - [Device-Defender](https://github.com/aws/device-defender-for-aws-iot-embedded-sdk), +[Device-Defender](https://github.com/aws/device-defender-for-aws-iot-embedded-sdk), [Device-Shadow](https://github.com/aws/device-shadow-for-aws-iot-embedded-sdk), [Fleet-Provisioning](https://github.com/aws/fleet-provisioning-for-aws-iot-embedded-sdk), [Jobs](https://github.com/aws/jobs-for-aws-iot-embedded-sdk), @@ -37,24 +37,24 @@ checks that are run on FreeRTOS libraries. [GNU Complexity](https://www.gnu.org/software/complexity/manual/complexity.html) to verify that the complexity score of library functions is less than 16. -* **Formatting** - Validates all C files of a FreeRTOS library repository comply to the -uncrustify formatting standard defined in [formatting](formatting/uncrustify.cfg). +* **[Clang-Formatting](https://clang.llvm.org/docs/ClangFormat.html)** - + Validates all code files of a repository comply to the formatting + standard defined in [clang-format](clang-formatting/.clang-format). -* **Clang-Formatting** - Validates all C files of a FreeRTOS library repository comply to the formatting - standard defined in [clang-format](clang-formatting/.clang-format). +* **[Uncrustify](https://github.com/uncrustify/uncrustify) Formatting** - + Validates all files of a repository comply to the formatting + standard defined in [uncrustify.cfg](formatting/uncrustify.cfg). -* **Uncrustify-formatting** - Validates all C files of a FreeRTOS library repository comply to the formatting - standard defined in [uncrustify.cfg](formatting/uncrustify.cfg). +* **Doxygen** - Validates that the doxygen manual of the repository can be + built without warnings. -* **Doxygen** - Validates that the doxygen manual of the FreeRTOS library can be built without - warnings. +* **Spellings** - Checks spelling, using [CSpell](https://cspell.org/), across + all files of a repository. Each FreeRTOS library repository + should have a **.github/.cSpellWords.txt** file. -* **Spellings** - Checks spellings across all files of the FreeRTOS library repository. Each - FreeRTOS library repository should have a **.github/.cSpellWords.txt** file. - -* **Coverage Cop** - Enforces that the unit tests of a FreeRTOS library meet the minimum thresholds -branch and line coverages. The **lcov** coverage output from running unit tests should be -available before using this action. +* **Coverage Cop** - Enforces that the unit tests of a FreeRTOS library meet +the minimum thresholds branch and line coverages. The **lcov** coverage output +from running unit tests should be available before using this action. * **Memory Statistics** - Generates table of memory estimates for library files used in FreeRTOS library documentation. The memory estimates are generated diff --git a/clang-formatting/filesWithFormattingErrors/testWithFormattingError.c b/clang-formatting/filesWithFormattingErrors/testWithFormattingError.c index f600ff52..90cf4c64 100644 --- a/clang-formatting/filesWithFormattingErrors/testWithFormattingError.c +++ b/clang-formatting/filesWithFormattingErrors/testWithFormattingError.c @@ -27,7 +27,7 @@ typedef struct DateAndTime currentTime->seconds = lt.wSecond; currentTime->msec = lt.wMilliseconds; } -#else /* if defined( WIN32 ) || defined ( _WIN32 ) || defined( __WIN32__ ) || defined( __NT__ ) || defined( WIN64 ) || defined( __WIN64 ) */ +#else /* if defined( WIN32 ) || defined ( _WIN32 ) || defined( __WIN32__ ) || defined( __NT__ ) || defined( WIN64 ) || defined( __WIN64 ) */ #include #include void getTime( struct DateAndTime * currentTime ) @@ -36,7 +36,7 @@ typedef struct DateAndTime struct tm * tm; gettimeofday( &tv, NULL ); - tm = localtime( &tv.tv_sec ); + tm = localtime( &tv.tv_sec ); currentTime->hour = tm->tm_hour; currentTime->minutes = tm->tm_min; currentTime->seconds = tm->tm_sec; @@ -78,7 +78,7 @@ int main( int argc, { getTime( ¤tTime ); printf( "%02llu:%02llu:%02llu.%03llu TEST APPLICATION SLEEPING FOR %d SECONDS\n", - currentTime.hour, + currentTime.hour, currentTime.minutes , currentTime.seconds, currentTime.msec, diff --git a/formatting/action.yml b/formatting/action.yml index 39828080..89fd83b6 100644 --- a/formatting/action.yml +++ b/formatting/action.yml @@ -151,5 +151,7 @@ runs: # ${{ env.stepName }} echo -e "${{ env.bashInfo }} A git patch of the formatting issues has been attached to this workflow ${{ env.bashEnd }}" echo -e "${{ env.bashInfo }} This can be accessed by returning to the bottom of the summary page of the workflow run ${{ env.bashEnd }}" - echo -e "${{ env.bashInfo }} At the bottom of the page will be a formattingChanges.patch file that you can download ${{ env.bashEnd }}" - echo -e "${{ env.bashInfo }} Copy this patch to your repository and apply it using 'git apply formattingChanges.patch' ${{ env.bashEnd }}" + echo -e "${{ env.bashInfo }} At the bottom of the page will be a formattingChanges.zip file that you can download. ${{ env.bashEnd }}" + echo -e "${{ env.bashInfo }} Extract the 'formattingChanges.patch' file inside of it, and copy it to your repository. ${{ env.bashEnd }}" + echo -e "${{ env.bashInfo }} From here you can apply it using 'git apply formattingChanges.patch', fixing your formatting issues. ${{ env.bashEnd }}" + echo -e "${{ env.bashInfo }} Or you can add the comment '/bot run formatting' on your Pull Request to have formatting changes automatically applied to your PR! ${{ env.bashEnd }}"