rat-pac / ratpac-two

Open source edition of RAT-PAC
Other
11 stars 23 forks source link

Formatting changes #111

Closed JamesJieranShen closed 9 months ago

JamesJieranShen commented 9 months ago

This PR addresses issue #108 and expands upon the Makefile changes made on PR #106 . Previously a pre-commit hook is added to a user's directory when ratpac is installed to prevent improperly formatted code from being introduced to the repo. This led to errors upon commit when clang-format is not installed. The following approach is adopted here:

  1. The formatting script will now print out the following error message and exit gracefully when clang-format is not present. clang-format is not installed. Formatting rules won't be auto applied upon commit. Consider installing clang-format to ensure consistent formatting across the project, especially if you plan to contribute.
  2. Upon pull requests and pushes, a github action will be ran to check if formatting across the repo is consistent throughout. If a formatting check has failed, maintainers can politely ask the contributor to modify their code before they are merged.