We've just activated the "pre-commit.ci" continuous integration app on GitHub -- this checks each incoming PR against
our .pre-commit-config.yaml setup. Right now, rather than rejecting PRs that don't meet the pre-commit requirements, the hook automatically generates a fix-up commit and adds it to your PR (this may change if it drives everyone crazy!). The easiest way to prevent this extra commit is to install the pre-commit hook on your local FreeCAD git repo as detailed in the
Developer's Handbook (see section "Setting Up for Development" item 3). This isn't strictly required: the settings it enforces can be hand-applied (for example, by configuring your IDE to format code according to our .clang-format file, running your Python through the Black reformatter with a 100 char line length, etc.).
The settings that are currently being enforced are:
- Trim Trailing Whitespace
- Fix End of Files
- Check Yaml
- Check for added large files
- Mixed line ending
- black (100 char line length)
- clang-format
This is currently being applied to the following subdirectories:
Code: Select all
src/Mod/AddonManager
src/Tools
tests/src
src/Mod/Assembly
src/Mod/Inspection
src/Mod/MeshPart
src/Mod/Points
src/Mod/ReverseEngineering
src/Mod/Sketcher
src/Mod/Surface
src/Mod/Start
src/Mod/Test
src/Mod/Web