Use pre-commit to check C++ and Python formatting
pre-commit is a very practical tool to automatically run checks on the files to be committed to the repository.
This MR adds a pre-commit configuration that invokes clang-format
and yapf
to replace the home made ci-utils/check-formatting
.
The only draw back is that the available versions of clang-format
start from 10, so there is a minor difference in the output when using it instead of clang-format-8
: the fixed the discrepancy between constructors invoked with parentheses and braces, so we get
std::string a( "a" );
std::string b{ "b" };
instead of
std::string a( "a" );
std::string b{"b"};
When we merge this, we can decide if to format everything or update the formatting only of the files we touch in each MR.
Merge request reports
Activity
changed milestone to %v36r2
assigned to @leggett
mentioned in commit 57379798
mentioned in merge request !1286 (merged)
mentioned in issue lhcb/Moore#361
mentioned in merge request lhcb-core/LbDevTools!215 (merged)
mentioned in merge request lhcb/LHCb!4346 (merged)