CAD_Sketcher icon indicating copy to clipboard operation
CAD_Sketcher copied to clipboard

Introduce formatting guidline

Open hlorus opened this issue 2 years ago • 2 comments

Automatic formatting can go along way to improve readability of the code and make our lives easier. Following are the steps to get there.

  • [ ] Evaluate and decide on options
  • [ ] Batch format the project
  • [ ] Add guidline to documentation
  • [ ] Add github action to check formatting on PRs

hlorus avatar Aug 11 '22 12:08 hlorus

Personally i would go with black as a formatter to keep it simple and avoid trouble with different configurations between contributors.

hlorus avatar Aug 11 '22 12:08 hlorus

seconding the Black idea. Black has the great advantage of being opinionated and consistent - theres only one parameter to adjust which is max line length and i would leave that at default.

This helps tremendously for preventing inconsistencies across contributors and PRs.

I also recommend using https://pre-commit.com/ as part of the setup to reduce the amount of github action checks failing on formatting or other linters.

laundmo avatar Aug 11 '22 12:08 laundmo

Okay, let's go with black for now.

hlorus avatar Aug 12 '22 08:08 hlorus

All done.

hlorus avatar Aug 17 '22 16:08 hlorus