Skip to content

provide auto-fix patch file (add fix-patch-path output) #376

Description

@2bndy5

The idea for this is related to

Here's a flowchart of the changes in #358

flowchart TD;
  isTidy{Is clang-tidy desired?}
  runTidy[Run clang-tidy]
  cacheTidy[Save clang-tidy fixes to cache]
  isFmt{Is clang-format desired?}
  runFmtOg[Run clang-format on event src file]
  hasTidyFixCache{Has clang-tidy cached any fixes?}
  do3wayDiff[Normalize event changed lines with clang-tidy fixed lines]
  runFmtTidy[Run clang-format on clang-tidy fixes]
  cacheFmt[Save clang-format fixes to cache]

  isTidy --yes--> runTidy --> cacheTidy --> isFmt;
  isTidy --no --> isFmt --yes--> runFmtOg --> hasTidyFixCache --no --> cacheFmt;
  hasTidyFixCache --yes--> do3wayDiff --> runFmtTidy;
Loading

What's next?

Now it is just a matter of presenting a patch file that users can consume.

My instinct says: Save the patch file in .cpp-linter-cache/auto-fix.patch. Then set a new output variable fix-patch-path pointing to the saved patch file.

From there users can save it as an artifact or do whatever with it. Using the patch file as an artifact in a different job allows for isolated contents: write permissions (needed by git push after doing git apply $PATCH_FILE).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions