Skip to content
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

Add GitHub Action to run static analysis for PR #131

Closed
skrobinson opened this issue Sep 14, 2021 · 7 comments
Closed

Add GitHub Action to run static analysis for PR #131

skrobinson opened this issue Sep 14, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@skrobinson
Copy link
Contributor

@p-ranav,

I am interested in adding the static analysis action you mentioned in #128. Do you have a clang-tidy config file you want me to use?

@p-ranav
Copy link
Owner

p-ranav commented Sep 15, 2021

I don't have one, no. For naming-related checks, e.g., readability-identifier-naming.VariableCase, it's probably worth our time to also address #133 where we can first change the coding style of the project.

@skrobinson
Copy link
Contributor Author

Do you know of a project using the StaticAnalysis Action? I've had few results and would like to learn from a working example.

@p-ranav
Copy link
Owner

p-ranav commented Sep 20, 2021

I use a variation of that action in some private projects for work.

Here's my fork of the action with some changes I wanted.

And here is an example project I just cooked up that uses the action. The PR shows the action commenting with error and style issues that were discovered.

@skrobinson
Copy link
Contributor Author

skrobinson commented Sep 21, 2021

I'm getting closer to a working SA report... The checks are running, errors are found (in the action log), but the SA Action reports everything is fine.

I have a running testbed at skrobinson#2

Do you have any ideas why?

@skrobinson
Copy link
Contributor Author

@p-ranav

My prototype PR Action to run StaticAnalysis (SA) is working at skrobinson/argparse#2. The commit history is a mess, but the SA reporting is what I expect. Now it's time to make some implementation decisions. I'm open to your decisions and here are my recommendations.

  1. Configure SA to match current style practices.
  2. With SA reporting 100% success, merge the Action commits.
  3. Begin a process of changing one clang-tidy check and updating argparse to meet the new check. A tidy change and source update would appear in the same commit. Repeat this process with occasional merges until argparse has been converted. I anticipate around 12 commits finish the style conversion.

I like this plan because it does not require replacing every line in a single commit and each changed line is for the same general reason. It does mean some lines may change more than once as corrections are made for different checks.

This plan also allows for delayed decision making. Pick the low-hanging fruit early and see how our thinking changes.

When I have a better idea of our direction, I'll make a clean branch and submit a PR.

@p-ranav
Copy link
Owner

p-ranav commented Nov 4, 2021

I like the plan and I agree with you - We can start small, from the current style and make incremental updates. I see what you have here and It's what I was hoping for!

@p-ranav p-ranav added the enhancement New feature or request label Sep 21, 2022
@skrobinson
Copy link
Contributor Author

With #215, the overall idea is complete and clang-tidy checks are run on PR. I'll keep watching for clang-format and cppcheck actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants