Skip to content

Conversation

@henryiii
Copy link
Collaborator

@henryiii henryiii commented Jun 8, 2022

I wasn't able to bump to clang-tidy 14 because it seems to be buggy about respecting the NOLINTNEXTLINE's in macros. Minor adjustments to running.

@henryiii henryiii force-pushed the henryiii/chore/tidy13 branch from 40537a1 to f5502ae Compare June 8, 2022 05:07
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii force-pushed the henryiii/chore/tidy13 branch from f5502ae to e863fbb Compare June 8, 2022 13:21
@Skylion007
Copy link
Collaborator

@henryiii Yeah, I've been waiting to do this PR until 14.0.5 is released. I've already backported the fix to llvm 14: llvm/llvm-project#55717


HeaderFilterRegex: 'pybind11/.*h'

WarningsAsErrors: '*'
Copy link
Collaborator

@Skylion007 Skylion007 Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@henryiii Any reason this is removed? If there are explicit checks which are giving warnings, they can be negated as errors in this part of the list. (ie. the same way as they can be negated from globs for the checksparam.

run: >
cmake -S . -B build
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy)"
-DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);--use-color;--warnings-as-errors=*"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skylion007 Warnings as errors is set here. It's more inconvenient running this locally with warnings as errors, since it stops the compilation (requiring --keep-going, for example). Notice the "local run" text changes too. It's better to have this as a user-control via CMAKE_CXX_CLANG_TIDY vs. always forcing it. (IMO)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there isn't much difference here since we have fixed the code base with nolints for all relevant errors. It would be useful for checks that are flaky like bugprone-unused-raii etc... so that new non-errant instances could be found if we ever want to enable it or if suppression stopped working for some reason (like in unpatched clang-tidy 14).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you like it then, or would you rather it the old way?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way works.

@henryiii henryiii merged commit 7c3a031 into pybind:master Jul 13, 2022
@henryiii henryiii deleted the henryiii/chore/tidy13 branch July 13, 2022 14:06
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Jul 13, 2022
@henryiii henryiii removed the needs changelog Possibly needs a changelog entry label Jul 15, 2022
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.

2 participants