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

Added modernize-use-auto to clang-tidy-checks #5397

Merged

Conversation

gnawme
Copy link
Contributor

@gnawme gnawme commented Aug 21, 2022

When clang-tidy checks were added to the Github workflow in #4636, modernize-use-auto was omitted.

Using auto can greatly enhance the readability and usability of the code.

@mvieth
Copy link
Member

mvieth commented Aug 22, 2022

Personally, I would e.g. prefer float and double over auto, because they are still very short but more expressive. How about increasing MinTypeNameLength (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-auto.html#cmdoption-arg-mintypenamelength) to 7? And maybe some of the for-loops with iterators can be converted to range-for-loops?

@gnawme gnawme force-pushed the norm.evangelista/add-modernize-use-auto branch from 4c8fa96 to 1857939 Compare August 23, 2022 04:50
@gnawme
Copy link
Contributor Author

gnawme commented Aug 23, 2022

Personally, I would e.g. prefer float and double over auto, because they are still very short but more expressive. How about increasing MinTypeNameLength (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-auto.html#cmdoption-arg-mintypenamelength) to 7? And maybe some of the for-loops with iterators can be converted to range-for-loops?

Thanks, yes, I think I'll follow both suggestions. Here is Part I, with MinTypeNameLength set

io/src/image_depth.cpp Outdated Show resolved Hide resolved
io/src/image_depth.cpp Outdated Show resolved Hide resolved
io/src/image_depth.cpp Outdated Show resolved Hide resolved
io/src/image_ir.cpp Outdated Show resolved Hide resolved
@gnawme gnawme force-pushed the norm.evangelista/add-modernize-use-auto branch from 12c1ad2 to 4d191b4 Compare August 26, 2022 18:01
@gnawme gnawme changed the title Added modernize-us-auto to clang-tidy-checks Added modernize-use-auto to clang-tidy-checks Sep 1, 2022
@gnawme gnawme force-pushed the norm.evangelista/add-modernize-use-auto branch from a2edbae to 3b2d134 Compare September 4, 2022 06:07
@mvieth
Copy link
Member

mvieth commented Sep 4, 2022

This pull request has gotten very big, far too big for a proper (and fast) review. Can you split it? Maybe move all commits after Fixed merge error (the first commit where all CI checks passed) to one or more additional pull requests? Thanks!

@gnawme gnawme force-pushed the norm.evangelista/add-modernize-use-auto branch from 3b2d134 to 9db6178 Compare September 4, 2022 22:27
@gnawme
Copy link
Contributor Author

gnawme commented Sep 4, 2022

This pull request has gotten very big, far too big for a proper (and fast) review. Can you split it? Maybe move all commits after Fixed merge error (the first commit where all CI checks passed) to one or more additional pull requests? Thanks!

Done, it's still quite a large PR, but I don't see a sensible way to split it further.

Copy link
Member

@mvieth mvieth left a comment

Choose a reason for hiding this comment

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

Thanks for splitting the PR

io/src/openni2_grabber.cpp Outdated Show resolved Hide resolved
simulation/tools/sim_viewer.cpp Outdated Show resolved Hide resolved
io/src/openni2_grabber.cpp Outdated Show resolved Hide resolved
Copy link
Member

@mvieth mvieth left a comment

Choose a reason for hiding this comment

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

Thanks!

@mvieth mvieth merged commit c80bfd2 into PointCloudLibrary:master Sep 9, 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.

None yet

3 participants