p-ranav / argparse

Argument Parser for Modern C++
MIT License
2.69k stars 243 forks source link

Add GitHub Action to run static analysis for PR #131

Closed skrobinson closed 2 years ago

skrobinson commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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?

skrobinson commented 3 years ago

@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 commented 3 years ago

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!

skrobinson commented 2 years ago

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.