Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clang tidy #1688

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

Merged
merged 4 commits into from
Dec 6, 2022
Merged

Clang tidy #1688

merged 4 commits into from
Dec 6, 2022

Conversation

thetic
Copy link
Contributor

@thetic thetic commented Nov 19, 2022

Most of these issues are pretty innocuous, but I did find a couple places that constructors/destructors were relying on dynamic dispatch.

@coveralls
Copy link

coveralls commented Nov 19, 2022

Coverage Status

Coverage increased (+0.0006%) to 99.336% when pulling 0ab65c6 on thetic:clang-tidy into f7607c7 on cpputest:master.

@thetic
Copy link
Contributor Author

thetic commented Nov 29, 2022

It looks to me like the CodeQL workflow is running clang-tidy under the hood, but isn't honoring the // NOLINT comments. What do you think about deleting it? The inline comments in PRs are really nice, but I don't think you can run CodeQL locally.

@offa I think you added CodeQL. What do you think?

@thetic
Copy link
Contributor Author

thetic commented Nov 29, 2022

Coverage Status

Coverage decreased (-0.0001%) to 99.625% when pulling d30c7b4 on thetic:clang-tidy into 5a715cf on cpputest:master.

I believe coverage went down because the StringFromOrdinalNumber implementation got smaller.

@thetic thetic marked this pull request as draft November 29, 2022 08:47
@offa
Copy link
Contributor

offa commented Nov 29, 2022

What do you think about deleting it?

Just to not confuse this: Delete what? The inline suppression?

According to these issues there's no inline mechanism available for CodeQL yet: github/codeql#9298, github/codeql#11427

Issues can be dismissed through Github UI only.

@thetic
Copy link
Contributor Author

thetic commented Nov 29, 2022

Sorry. I'm proposing deleting the CodeQL config in favor of clang-tidy.

These are the trade-offs that I see:

  • Their results appear to be the same
  • CodeQL doesn't support inline suppression, so we get noisy failures.
  • Clang-tidy can be run locally.
  • Clang-tidy doesn't create MR comments.

@offa
Copy link
Contributor

offa commented Nov 29, 2022

I don't think they are same. CodeQL does more than static code analysis, eg. it contains queries for known security issues and variant analysis. Since it's implemented around queries I wouldn't expect it to call clang-tidy. As far as I know the former are implemented by Github or security researchers and do not use third party rules directly (I may be wrong here though).

While it may report the same result as clang-tidy here, both are different tools. Indeed, the missing inline suppression is annoying and waiting for a maintainer to suppress it through UI isn't an option. On the other hand only severe levels like errors should fail the build, and these are typically issues to address.

Btw. the sizeof() usage in the line above really looks Suspicious. :-)

@thetic
Copy link
Contributor Author

thetic commented Nov 29, 2022

Gotcha, thank you for the context. I think you're right, then; we should keep CodeQL.

@offa
Copy link
Contributor

offa commented Nov 29, 2022

This shouldn't block or otherwise stop this PR of course! 👍

@thetic thetic marked this pull request as ready for review December 5, 2022 16:46
Most of these issues are pretty innocuous, but I did find a couple
places that constructors/destructors were relying on dynamic dispatch.
@basvodde
Copy link
Member

basvodde commented Dec 6, 2022

Ok, many small fixes. I'll merge it even though I see some builds not ready yet.

@basvodde basvodde merged commit 7e278c4 into cpputest:master Dec 6, 2022
@thetic thetic deleted the clang-tidy branch December 6, 2022 07:29
@thetic
Copy link
Contributor Author

thetic commented Dec 6, 2022

Ok, many small fixes. I'll merge it even though I see some builds not ready yet.

Kill any jobs you'd like on appveyor. Nothing will pass until #1702 merges.

@basvodde
Copy link
Member

basvodde commented Dec 6, 2022

Merged before I read this :)

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 this pull request may close these issues.

4 participants