-
Notifications
You must be signed in to change notification settings - Fork 97
feat: CI - Add code rules checking action #3914
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
base: develop
Are you sure you want to change the base?
Conversation
…EV/GEOS into feat/dudes/add-code-rules
MelReyCG
left a comment
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.
I think you showed that script works, but it seems that there are some critical issues in it.
| # - name: Ubuntu debug (20.04, gcc 10.5.0, open-mpi 4.0.3) - github codespaces | ||
| # CMAKE_BUILD_TYPE: Debug | ||
| # DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc10 | ||
| # BUILD_SHARED_LIBS: ON | ||
| # ENABLE_HYPRE: OFF | ||
| # ENABLE_TRILINOS: ON | ||
| # GEOS_ENABLE_BOUNDS_CHECK: ON | ||
| # HOST_CONFIG: /spack-generated.cmake |
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.
you cannot leave CI modifs aimed for test and request review.
| # - name: Check code rules | ||
| # BUILD_AND_TEST_ARGS: --test-code-rules |
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.
Why is it commented out?
| FULL_FILE_PATTERN="${FILE_PREFIX}${FILE_PATTERNS[*]}" | ||
| # Build the find command | ||
| FIND_CMD="find" | ||
| FIND_FILE_CMD="$FIND_CMD $FILE_PATH_PATERN"' \( -name "*.hpp" -o -name "*.cpp" \)' |
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.
FILE_PATH_PATTERN seems never initialized.
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.
should you add -f?
| FILES=$(eval "$FIND_FILE_CMD" 2>/dev/null); | ||
|
|
||
| # Main loop | ||
| for file in $FILES; do |
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.
How does it behave with spaces in folder / file names?
| ARRAY_UMAP=() | ||
| ARRAY_VECTOR=() | ||
|
|
||
| FULL_FILE_PATTERN="${FILE_PREFIX}${FILE_PATTERNS[*]}" |
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.
I'm not sure to get that right, but does it result to the following?
src/coreComponents/codingUtilities/* common/* dataRepository/* ...
If yes, how can it work as the file prefix is not added to each file pattern? maybe it would be easier with a cd FILE_PREFIX (rename to VALIDATING_FOLDER?)
| print_violation "$MAP_VIOLATIONS_FOUND" ARRAY_MAP "std::map" | ||
| print_violation "$UMAP_VIOLATIONS_FOUND" ARRAY_UMAP "std::unordered_map" | ||
| print_violation "$VECTOR_VIOLATIONS_FOUND" ARRAY_VECTOR "std::vector" |
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.
- Add an array for them,
- did you missed
std::array?
This PR aim to create a new CI Target in order to ensure the use of the internal tool in geos and to promote the best coding practice.
First, this PR set up the CI
check_code_rulesand will ensure the use of :stdMap,stdUnorderedMap&stdVectorThis PR will be merged after :