Add GitHub Action to run static analysis for PR
@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?
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.
Do you know of a project using the StaticAnalysis Action? I've had few results and would like to learn from a working example.
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.
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/argparse#2
Do you have any ideas why?
@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.
- Configure SA to match current style practices.
- With SA reporting 100% success, merge the Action commits.
- Begin a process of changing one clang-tidy check and updating
argparseto meet the new check. A tidy change and source update would appear in the same commit. Repeat this process with occasional merges untilargparsehas 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.
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!
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.