diff --git a/.gitignore b/.gitignore index 92293e45..9e53c183 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ !.cmake-format.json !.gitattributes !.gitignore +!.pre-commit-config.yaml !BUILDING.md !buildspec.json !CMakeLists.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..02ca6e87 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v16.0.6 + hooks: + - id: clang-format + args: [-fallback-style=none] + types_or: [c++, c] + exclude: | + (?x)^( + deps/.*| + tests/catch\.hpp| + .*\.mm + )$ + + - repo: https://github.com/cheshirekow/cmake-format-precommit + rev: v0.6.13 + hooks: + - id: cmake-format + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.2 + hooks: + - id: ruff-format + types_or: [python] \ No newline at end of file diff --git a/README.md b/README.md index fddbab0e..56008f4e 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,5 @@ sudo snap install obs-studio ## Contributing - If you wish to contribute code to the project, have a look at this [section](BUILDING.md) describing how to compile the plugin. +- You can optionally use [pre-commit](https://pre-commit.com) to automatically handle formatting. - If you wish to contribute translations, feel free to submit pull requests for the corresponding files under `data/locale`.