Skip to content

sca: add ECLAIR configuration for main Coding Guidelines rules and a ECLAIR workflow #90345

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

LucaCiucci
Copy link

@LucaCiucci LucaCiucci commented May 22, 2025

Add a "zephyr_guidelines" selection that reflects the main Conding Guidelines list.

This PR also introduces a workflow (eclair_guidelines_check.yaml) to use the "first_analysis" selection on a self-hosted runner.
The workflow can be easily adapted to other selections, for example:

         run: |
           source .venv/bin/activate
           west build -b nrf52dk/nrf52805 samples/basic/blinky --   \
-            -DZEPHYR_SCA_VARIANT=eclair -DECLAIR_RULESET_FIRST_ANALYSIS=ON \
+            -DZEPHYR_SCA_VARIANT=eclair -DECLAIR_RULESET_ZEPHYR_GUIDELINES=ON \
+            -DECLAIR_RULESET_FIRST_ANALYSIS=OFF \
             -DECLAIR_SUMMARY_HTML=ON      \
             -DECLAIR_REPORTS_SARIF=ON

This PR also introduces some enhancements to cmake/sca/eclair/sca.cmake and some fixes to the documentation.

Signed-off-by: Luca Ciucci [email protected]

Copy link

Hello @LucaCiucci, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

nvetrini and others added 5 commits May 22, 2025 19:39
Various improvements to the integration files in order to obtain correct
static analysis results:
- variable `ECLAIR_WORKSPACE' is set to the build output directory, to
  allow multiple ECLAIR analyses running in parallel on the same machine
  without conflicts;
- fix the evaluation order of rulesets to allow a user-provided ruleset to
  be selected without a cmake options file that undefines other
  ECLAIR_RULESET_* variables;
- add a clean-only frame to initiate the analysis and a project
  frame to end it.

Signed-off-by: Nicola Vetrini <[email protected]>
This check prevents misconfigurations where more than one ruleset is
selected, ensuring that the analysis is not silently performed with
an unintended configuration.

Signed-off-by: Luca Ciucci <[email protected]>
Added the main rules from the conding guidelines selection listed in
/doc/contribute/coding_guidelines/index.rst to the zephyr_guidelines
configuration.

Signed-off-by: Luca Ciucci <[email protected]>
Added prerequisites section, fixed some typos and added
ECLAIR_RULESET_ZEPHYR_GUIDELINES option.
Also updated dead doc string links in ECLAIR configuration files.

Signed-off-by: Luca Ciucci <[email protected]>
Introduce ECLAIR_SUMMARY_HTML and ECLAIR_FULL_HTML CMake options to
enable the generation of HTML reports.

Signed-off-by: Luca Ciucci <[email protected]>
@@ -0,0 +1,59 @@
name: "Eclair Zephyr Guideline Selection Check"
Copy link
Member

Choose a reason for hiding this comment

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

need to drop this from the PR, we will have to add the worflow later. this workflow will not work as is.

Choose a reason for hiding this comment

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

Ok, no problem

@LucaCiucci
Copy link
Author

Dropped d736c60 (eclair_guidelines_check.yaml).

Copy link

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

Successfully merging this pull request may close these issues.

4 participants