-
Notifications
You must be signed in to change notification settings - Fork 206
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
Fix #1161, #1130 Apply and check standard code format #1219
Conversation
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.
Many splits should be cleaned up... Stopped after identifying 10
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \arg #CFE_PSP_RST_TYPE_PROCESSOR - Attempts to retain volatile disk, critical data store and user reserved memory. | ||
** \arg #CFE_PSP_RST_TYPE_POWERON - Causes all memory to be cleared | ||
** \arg #CFE_PSP_RST_TYPE_PROCESSOR - Attempts to retain volatile disk, critical data store | ||
*and user reserved memory. |
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.
Fix line split
modules/core_api/fsw/inc/cfe_es.h
Outdated
** The caller can set this pointer to NULL if the Sub-Type is of no interest. \n | ||
**ResetSubtypePtr If the provided pointer was not \c NULL, the Reset Sub-Type is stored at the given address. | ||
** For a list of possible Sub-Type values, see \link #CFE_PSP_RST_SUBTYPE_POWER_CYCLE | ||
*"Reset Sub-Types" \endlink. |
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.
Fix line splits
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \param[out] TaskInfo Pointer to a \c CFE_ES_TaskInfo_t structure that holds the specific | ||
** task information. *TaskInfo is the filled out \c CFE_ES_TaskInfo_t structure containing | ||
*the | ||
** Task Name, Parent App Name, Parent App ID among other fields. |
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.
Fix line split
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \param[in, out] TaskIdPtr A pointer to a variable that will be filled in with the new task's ID. *TaskIdPtr is | ||
*the Task ID of the newly created child task. |
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.
Fix line split
** \param[in] TaskId The task ID previously obtained when the Child Task was created with the | ||
*#CFE_ES_CreateChildTask API. |
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.
Fix line split
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \param[in, out] HandlePtr Pointer Application's variable that will contain the CDS Memory Block Handle. | ||
**HandlePtr is the handle of the CDS block that can be used in |
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.
Fix line split
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \param[in, out] RestoreToMemory A Pointer to the block of memory that is to be restored with the contents of the | ||
*CDS. *RestoreToMemory is the contents of the specified CDS. |
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.
Fix line split
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \param[in, out] PoolID A pointer to the variable the caller wishes to have the memory pool handle kept in. | ||
**PoolID is the memory pool handle. |
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.
Fix line split
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \param[in, out] PoolID A pointer to the variable the caller wishes to have the memory pool handle kept in. | ||
**PoolID is the memory pool handle. |
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.
Fix line split
modules/core_api/fsw/inc/cfe_es.h
Outdated
** \param[in] Size The size of the pool of memory. Note that this must be an integral number of 32 bit | ||
*words. | ||
** | ||
** \param[in] NumBlockSizes The number of different block sizes specified in the \c BlockSizes array. If set equal to | ||
** zero or if greater than 17, then default block sizes are used. | ||
** | ||
** \param[in] BlockSizes Pointer to an array of sizes to be used instead of the default block sizes specified by | ||
** #CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 through #CFE_PLATFORM_ES_MAX_BLOCK_SIZE. If the pointer is equal to NULL, | ||
** #CFE_PLATFORM_ES_MEM_BLOCK_SIZE_01 through #CFE_PLATFORM_ES_MAX_BLOCK_SIZE. If the | ||
*pointer is equal to NULL, | ||
** the default block sizes are used. | ||
** | ||
** \param[in] UseMutex Flag indicating whether the new memory pool will be processing with mutex handling or not. | ||
** \param[in] UseMutex Flag indicating whether the new memory pool will be processing with mutex handling or | ||
*not. |
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.
Fix line splits
Note - could just merge as-is and clean up in follow-on. This is all due to the original having violated the 120 character rule, so it was bad then and it's bad now. The critical point is to get the bulk format in since in general it's a huge consistency improvement. |
Is the problem is mainly ensuring the two So we'd like this "bad" example
to look like this (at the very least)
or in a perfect world look like
|
This is where I recommend (and have recommended in the past) going to a single "*" char rather than "**" on the block comments. I think most tools/auto-formatters work better with this pattern, the double * is a little unusual.... (Might be possible to fix this with a sed script) |
What's the history and reasoning behind the |
No reason AFAIK, someone used it at one time, and others copied. In most IDEs I've used it defaults to just a single *, and I think in this case its confusing clang-format and causing the weird breaks you are seeing. |
The GSFC coding standard uses |
That coding standard keeps haunting us! |
Is it really part of the coding standard or did they just happen to use ** in the examples? There's a difference - in a standards document unless they use "shall"/"must" statements - then they are just examples, not requirements. As a contributing author to some standards document, its frustrating when readers misinterpret examples as requirements. Either way - its a case where we should really consider weighing compatibility with current industry standards vs. compatibility with some examples in a document written many years ago that may not have a real reason behind it other than being what was frequently used in code in that organization at that time (which itself I assume was nothing more than the personal preference of some original authors). Not that I have a strong preference - from my POV it is simply a question of how much time will be spent manually fixing up the statements - neither Eclipse nor VS Code nor clang-format seem to work well with We can certainly keep the |
Random question, how does doxygen deal with the |
Doxygen seems generally OK with it, as long as the opening comment block starts with the correct flag (e.g. |
d30accd
to
135f52a
Compare
There is no requirement to use the |
135f52a
to
9f7a28f
Compare
It would be nice to also check for superfluous whitespace in the |
e3bf7dc
to
4213edd
Compare
Did a check in a bunch of files while I was at it. |
2a5cb10
to
6c5d305
Compare
Applies standard format using the .clang-format configuration from the cFS bundle Hand edits some files to account for comment splits
Adds a continuous integration check to ensure new commits adhere to standard format. Some minor format fix
48f2610
to
d882a61
Compare
Removes trailing whitespace in: - CMakeLists.txt - *.cmake
Removes trailing whitespace in: - *.dox - *doxyfile.in
Excludes .md, .pdf, and .doc
d882a61
to
f257ae5
Compare
Describe the contribution
Fix #1161
Fix #1130
Testing performed
See checks tab https://github.com/nasa/cFE/pull/1219/checks
Bundle (fork) test: https://github.com/astrogeco/cFS/pull/8/checks
Expected behavior changes
Adds new github actions workflow that checks format. This workflow runs on both "push" and "pull_request" for all branches so at the moment it will trigger twice for any branch that is part of a pull request
System(s) tested on
Ubuntu 18.04
Additional context
Will create a tag after merge
Third party code
None