Skip to content

Update static analysis - #11342

Merged
maloel merged 2 commits into
realsenseai:developmentfrom
maloel:static
Jan 23, 2023
Merged

Update static analysis#11342
maloel merged 2 commits into
realsenseai:developmentfrom
maloel:static

Conversation

@maloel

@maloel maloel commented Jan 22, 2023

Copy link
Copy Markdown
Contributor
  • parse the cppcheck log to show a summary
  • store on git the golden log
  • change static_analysis to actually show diffs
  • remove the golden error count from static analysis -- it does this automatically from the golden log
  • fail even if same # of errors, if there are diffs

@maloel
maloel requested review from Nir-Az and OhadMeir and removed request for OhadMeir January 22, 2023 12:45
@Nir-Az
Nir-Az requested a review from OhadMeir January 22, 2023 12:50
ERROR_COUNT=$(grep cppcheck_run.log -e "severity=\"error\"" -c);
if [ $ERROR_COUNT -eq ${{env.CPPCHECK_EXPECTED_ERROR_COUNT}} ];
ERROR_COUNT=$(grep cppcheck_run.log -e "severity=\"error\"" -c)
EXPECTED_ERROR_COUNT=$(grep .github/workflows/cppcheck_run.log -e "severity=\"error\"" -c)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shouldn't expected be parsed from golden?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ahhh... I see that the file you saved is not named golden. Change it's name to something with "gold", or "expected" in it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's the name of the file that's the same as the artifact.
I needed the "golden" to distinguish the two generated "parsed" files, that's all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That way, you can simply copy the artifact on top of the original and not have to change any filenames etc.


path: |
cppcheck_run.log
cppcheck_run.parsed.log

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the parsed log supposed to be uploaded? I did not see it saved in your last run GH actions.
I don't think that we do need to save it, we can always run the script to parse cppcheck_run.log if needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right. But it's uploaded because it doesn't cost us anything and it makes it easier to look at without knowing how to run the script.

@OhadMeir OhadMeir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@maloel
maloel merged commit 16d1ee4 into realsenseai:development Jan 23, 2023
@maloel
maloel deleted the static branch January 23, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants