CADET-Core
CADET-Core copied to clipboard
Automatic code formatting using pre-commit and clang-format
Enables support for pre-commit and clang-format. Code is automatically formatted before committing.
Options for clang-format are documented here. I used this online preview for various clang-format settings. I'm still not fully satisfied, but it's a start.
I'm not sure how this PR will impact other PRs and their "mergeability".
This would fix #99.
I like this! :)
Thank you for your submission, we really appreciate it!
Like many open-source projects we ask that you sign our Contributor License Agreement before we can accept your contribution. To sign, please post two separate comments based on the following templates 👇
- Comment:
- [ ] The CADET maintainers know my real name.
At least one of the following two applies:
- [ ] The CADET maintainers know my current employer.
- [ ] I am *not* making this contribution on behalf of my current employer.
- Comment:
I have read the CLA Document and I hereby sign the CLA.
1 out of 2 committers have signed the CLA.
:white_check_mark: (ronald-jaepel)[https://github.com/ronald-jaepel]
:x: @sleweke
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.
I've updated the PR to the current master, updated clang and re-formatted everything to confirm nothing breaks.
The ExternalFunctionTemplate.cpp files are whitespace sensitive, so they can't be reformatted. This can be acchieved by renaming them to .cpp.in template "input" files, that are then treated properly by clang.
To set up on windows:
- activate proper python env (conda or venv)
pip install pre-commitpre-commit.exe installin the source code folder
To process all files with the new pre-committ workflow:
pre-commit run --all-files