Add pre-commit hooks

This commit is contained in:
Przemek Pawlas 2024-03-13 22:49:50 +01:00 committed by WarmUpTill
parent 6df818503e
commit c72f9abc2b
3 changed files with 26 additions and 0 deletions

1
.gitignore vendored
View File

@ -16,6 +16,7 @@
!.cmake-format.json
!.gitattributes
!.gitignore
!.pre-commit-config.yaml
!BUILDING.md
!buildspec.json
!CMakeLists.txt

24
.pre-commit-config.yaml Normal file
View File

@ -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]

View File

@ -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`.