ComputationalRadiationPhysics / contributing

:books: guidelines and styles to contribute to our projects
Creative Commons Attribution 4.0 International
6 stars 10 forks source link

[clang-tidy] Constness checks #46

Closed j-stephan closed 3 years ago

j-stephan commented 4 years ago

This PR includes the checks that deal with correct constness. Voting will end on 17 November 2020, 18:00 HZDR time.

Included checks:

Vote

Check Enable Disable
Postfix operator must be const 1 0
Misplaced const 1 0
Avoid const parameters 1 0
Avoid const return types 1 0
Use const pointer parameters 1 0
bernhardmgruber commented 4 years ago
Check Enable Disable Comment
Postfix operator must be const 1 1 It is always weird to return by const value. This could also prevent move optimizations. And it contradicts the Avoid const return types check.
Misplaced const 2 0
Avoid const parameters 2 0
Avoid const return types 2 0
Use const pointer parameters 2 0
sbastrakov commented 4 years ago
Check Enable Disable Comment
Postfix operator must be const 1 2 I agree with Bernhard, but this is also rather rare I think
Misplaced const 3 0  
Avoid const parameters 3 0 Note: as the linked docs say, it applies only to function declarations, not definitions (which is good)
Avoid const return types 3 0  
Use const pointer parameters 3 0  
j-stephan commented 3 years ago

Please merge this!