diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fb75ecc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +fail_fast: false +repos: + - repo: https://github.com/pocc/pre-commit-hooks + rev: v1.3.5 + hooks: + - id: clang-format + args: [--style=Google] + # - id: clang-tidy diff --git a/commit_hook_instructions.md b/commit_hook_instructions.md new file mode 100644 index 0000000..2237cce --- /dev/null +++ b/commit_hook_instructions.md @@ -0,0 +1,19 @@ +For pre commit hooks install the following. Note that clang-tidy is only readily available on linux. Clang-tidy has to be built manually in other OS. +If using linux, uncomment line 9 to use clang-tidy. + +```bash +brew install pre-commit +brew install llvm +pre-commit install +pre-commit run --all-files +``` + +After running the installation. The hooks will run every commit. + +List of resources can be found below: +https://pre-commit.com/ +https://clang.llvm.org/extra/clang-tidy/ +https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html +https://github.com/pocc/pre-commit-hooks +https://www.kdab.com/clang-tidy-part-1-modernize-source-code-using-c11c14/ +https://stackoverflow.com/questions/47255526/how-to-build-the-latest-clang-tidy \ No newline at end of file diff --git a/readme.md b/readme.md index 2eb231d..69fee6d 100644 --- a/readme.md +++ b/readme.md @@ -10,6 +10,7 @@ cd BMS_SW_G5 git submodule --init --recursive --remote ``` + # Build Start by building the `WLoopCan` submodule and then the BMS files