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

Allow output of clang-tidy fixes file #796

Open
EzraBrooks opened this issue Oct 14, 2022 · 10 comments · May be fixed by #798
Open

Allow output of clang-tidy fixes file #796

EzraBrooks opened this issue Oct 14, 2022 · 10 comments · May be fixed by #798

Comments

@EzraBrooks
Copy link

I'd like to be able to keep the clang-tidy fixes file generated during an industrial_ci run, so I can load it into other tools that generate reports - or just export it and use it to run fixes.

@rhaschke
Copy link
Contributor

Have a look at this example. Here, the applied changes are provided as a build artifact in GHA.

@EzraBrooks
Copy link
Author

That link doesn't work for me for some reason, but I was able to see the same thing on the main branch. Is that uploading a file called clang-tidy? Is that formatted the same way as a fixes file, or is it a different format of report generated by ICI?

@rhaschke
Copy link
Contributor

No, the provided file is directly a git patch file.

@EzraBrooks
Copy link
Author

Okay, well then my feature request still stands 😄

It would be nice to have the actual content of the fixes file for tools that accept it, for instance this Action that can annotate clang-tidy fixes directly onto PR diffs.

@rhaschke
Copy link
Contributor

I see.
@mathias-luedtke, what do you suggest to transfer a file generated within the ICI docker container to the calling GHA process?

@mathias-luedtke
Copy link
Member

It should be possible to to do that with the current set of features.

  • set CLANG_TIDY_ARGS to export the fixes file
  • expose the result (if not already accessible): use shell isolation, set BASEDIR or DOCKER_RUN_OPTS

We could think of always exporting the file, if the default location is reasonable.

@mathias-luedtke
Copy link
Member

@EzraBrooks: Do you know if multiple fixes files can be merged (or at least appended). And we might have a problem with the different paths (inside workspace and repository)..

@EzraBrooks
Copy link
Author

I already tried adding a new -export-files argument via that environment variable. Unfortunately it can only be passed once, so the fact that industrial_ci's internals already pass it means adding it to that variable crashes the tests.

@EzraBrooks
Copy link
Author

Unsure about merging them. I was able to produce reasonable output in my project's workspace using run-clang-tidy on the workspace root, instead of clang-tidy on each package, though. But since I was doing that outside the context of the industrial_ci container I didn't have any of the dependencies I needed for its analysis, which is why I'd like the feature in ICI.

@rhaschke
Copy link
Contributor

I will have a look. Being able to provide feedback in github would be great!

@rhaschke rhaschke linked a pull request Oct 20, 2022 that will close this issue
3 tasks
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 a pull request may close this issue.

3 participants