New CI tool active: pre-commit.ci

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Post Reply
User avatar
chennes
Veteran
Posts: 3583
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

New CI tool active: pre-commit.ci

Post by chennes »

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
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply