Skip to content

Commit

Permalink
Cleanup the readme, remove the rust spell check tests, update the cla…
Browse files Browse the repository at this point in the history
…ng-format tests a bit
  • Loading branch information
Skptak committed Sep 5, 2023
1 parent e0617e3 commit a3f29f8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 81 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
70 changes: 14 additions & 56 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
*.sh
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ 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)
[corePKCS11](https://github.com/FreeRTOS/corePKCS11),
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),
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/time.h>
#include <unistd.h>
void getTime( struct DateAndTime * currentTime )
Expand All @@ -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;
Expand Down Expand Up @@ -78,7 +78,7 @@ int main( int argc,
{
getTime( &currentTime );
printf( "%02llu:%02llu:%02llu.%03llu TEST APPLICATION SLEEPING FOR %d SECONDS\n",
currentTime.hour,
currentTime.hour,
currentTime.minutes ,
currentTime.seconds,
currentTime.msec,
Expand Down
6 changes: 4 additions & 2 deletions formatting/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

0 comments on commit a3f29f8

Please sign in to comment.