Skip to content

Conversation

@arng40
Copy link
Contributor

@arng40 arng40 commented Nov 18, 2025

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_rules and will ensure the use of : stdMap, stdUnorderedMap& stdVector
This PR will be merged after :

@arng40 arng40 self-assigned this Nov 18, 2025
@arng40 arng40 added type: CI Concerns github workflows or generic CI DO NOT MERGE ! flag: no rebaseline Does not require rebaseline labels Nov 18, 2025
@arng40 arng40 requested a review from herve-gross as a code owner November 19, 2025 16:05
@MelReyCG MelReyCG changed the title feat: CI - Add code rules feat: CI - Add code rules checking Nov 27, 2025
@MelReyCG MelReyCG changed the title feat: CI - Add code rules checking feat: CI - Add code rules checking script Nov 27, 2025
@MelReyCG MelReyCG changed the title feat: CI - Add code rules checking script feat: CI - Add code rules checking action Nov 27, 2025
Copy link
Contributor

@MelReyCG MelReyCG left a 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.

Comment on lines +177 to +184
# - 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
Copy link
Contributor

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.

Comment on lines +130 to +131
# - name: Check code rules
# BUILD_AND_TEST_ARGS: --test-code-rules
Copy link
Contributor

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" \)'
Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor

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[*]}"
Copy link
Contributor

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?)

Comment on lines +107 to +109
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"
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE ! flag: no rebaseline Does not require rebaseline type: CI Concerns github workflows or generic CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants