Make cpp-format targets always working#1118
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1118 +/- ##
==========================================
+ Coverage 93.57% 93.62% +0.04%
==========================================
Files 52 52
Lines 4483 4483
==========================================
+ Hits 4195 4197 +2
+ Misses 288 286 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @karczex)
CMakeLists.txt, line 193 at r1 (raw file):
endif() if(CHECK_CPP_STYLE)
this change was initially done to avoid looking for clang-format (v. 9) on some OSes. It will be an issue on these OSes, which don't have the required clang-format, so I believe it's not the solution.. 😉
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @karczex)
CMakeLists.txt, line 193 at r1 (raw file):
Previously, lukaszstolarczuk (Łukasz Stolarczuk) wrote…
this change was initially done to avoid looking for clang-format (v. 9) on some OSes. It will be an issue on these OSes, which don't have the required clang-format, so I believe it's not the solution.. 😉
or maybe not 😄
but pls check the other OSes
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
beside the two minor issues it looks good 👍
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @karczex)
CMakeLists.txt, line 186 at r1 (raw file):
BSD-3-Clause) find_program(CLANG_FORMAT NAMES clang-format clang-format-9 clang-format-9.0)
I guess we should re-order these names - firstly try to find cf9 (and 9.0), then cf
CMakeLists.txt, line 189 at r1 (raw file):
set(CLANG_FORMAT_REQUIRED "9.0") if(CLANG_FORMAT) message(STATUS "Found clang-format: ${CLANG_FORMAT} (version: ${CLANG_FORMAT_VERSION})")
pls switch the order of these two lines - ${CLANG_FORMAT_VERSION} is only set after the get_program_version_major_minor function call 😉
KFilipek
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @karczex)
igchor
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @karczex)
cmake/functions.cmake, line 102 at r1 (raw file):
# ${name} must be unique. function(add_cppstyle name) if(NOT CLANG_FORMAT AND NOT (CLANG_FORMAT_VERSION VERSION_EQUAL CLANG_FORMAT_REQUIRED))
AND? Shouldn't this be OR?
As cpp-format targets are always generated anyway, they should work even if CHECK_CPP_STYLE flag is disabled.
6721c39 to
7e2a005
Compare
karczex
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @igchor, @KFilipek, and @lukaszstolarczuk)
CMakeLists.txt, line 186 at r1 (raw file):
Previously, lukaszstolarczuk (Łukasz Stolarczuk) wrote…
I guess we should re-order these names - firstly try to find cf9 (and 9.0), then cf
Done.
CMakeLists.txt, line 189 at r1 (raw file):
Previously, lukaszstolarczuk (Łukasz Stolarczuk) wrote…
pls switch the order of these two lines -
${CLANG_FORMAT_VERSION}is only set after theget_program_version_major_minorfunction call 😉
Done.
cmake/functions.cmake, line 102 at r1 (raw file):
Previously, igchor (Igor Chorążewicz) wrote…
AND? Shouldn't this be OR?
Done.
KFilipek
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @igchor and @lukaszstolarczuk)
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @igchor)
As cpp-format targets are always generated anyway, they should work even
if CHECK_CPP_STYLE flag is disabled.
This change is