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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array still not in GEOS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK
would you mind adding an array for forbidden strings? as it is you have dupplicated strings + repetitive code.

--test-code-style
--test-documentation
-h | --help
-h | --help
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe reversible whitespace edition for PR's clarity sake

- are_submodules_in_sync
- check_code_style_and_documentation
- cpu_builds
- check_code_standards
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If check_code_standards is just rename of check_code_style_and_documentation why ?
And why check_code_rules is not required here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at CI checks, it is indeed then an advisory but not required enforcement ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll revert that

needs.check_code_style_and_documentation.result == 'success' &&
needs.cpu_builds.result == 'success' &&
needs.cuda_builds.result == 'success' &&
needs.check_code_standards.result == 'success' &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was need.cpu_builds.results and its cuda counterpart removed while dev to speed up or is it permanent ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was to speed up

"mesh/*"
"physicsSolvers/*"
)
EXCLUDE_PATTERNS=(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent ?

Comment on lines +153 to +154
- name: Check the code rules
run: "scripts/check_code_rules.sh"
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 no longer grouped with the code style & docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not executed the same way as code style & docs

## III. MAIN LOOP
################################

for file in ${ARRAY_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.

IIUC, this array can have spaces too, doesn't it need "?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed

fi
done

EXCLUDE_EXPRESSION=()
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 confused, does it excludes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I make it clearer

@arng40 arng40 requested review from MelReyCG and jafranc December 8, 2025 13:09
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.

4 participants