-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Request For Comment: Add additional PR checks for formatting #274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8b0dfdd
to
b24066f
Compare
b24066f
to
0f165d5
Compare
@@ -0,0 +1,18 @@ | |||
# See https://pre-commit.com for more information | |||
# See https://pre-commit.com/hooks.html for more hooks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May want to add the uncrustify
check from github.com/pocc/pre-commit-hooks
and move a copy of the formatting config to this kernel repo. https://github.com/FreeRTOS/FreeRTOS/blob/master/tools/uncrustify.cfg
paulbartell#10 is an initial attempt to use uncrustify for formatting. Not sure if a pre-commit hook is the best path forward, since that can be pretty annoying with unexpected formatting rewrites and having to constantly use |
The uncrustify pre-commit hook needs some configuration so that it acts as one would expect. Namely, it needs to only run on files that have changed and operate in-place without leaving backup files everywhere. I'll do some debugging on this later this week. |
I believe that's how it currently operates by default (at least that's what I've observed in paulbartell#10 locally). My point is that we may not want pre-commit to auto-edit files "behind the scenes" when a user simply wants to make a local commit. |
For sure. It should be optional. You can always run "pre-commit" from within a git repo without installing it as a git pre-commit hook. |
Codecov Report
@@ Coverage Diff @@
## main #274 +/- ##
=======================================
Coverage 92.13% 92.13%
=======================================
Files 4 4
Lines 1272 1272
Branches 342 342
=======================================
Hits 1172 1172
Misses 53 53
Partials 47 47
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
* Use unsigned types/constants where needed. * Address MISRA 21.15 violations in FreeRTOS_Sockets.c * Address MISRA rule violations in code (primarily Rule 2.2) * Inline had been disabled for Coverity builds, preventing Coverity from correctly identifying dead code; this change removes the disabling of inline during Coverity builds. * Added an explanation for the inline suppression of Rule 11.4 in prvSocketValid(). Co-authored-by: Aniruddha Kanhere <[email protected]>
Add some additional linters from the pre-commit project.
Specifically enable these checks on files that have changed as part of a pull-request:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.