setup pre-commit hooks for clang-format and prettier
This commit is contained in:
parent
b84d29c384
commit
11d990e59a
2 changed files with 19 additions and 0 deletions
12
.pre-commit-config.yaml
Normal file
12
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
fail_fast: false
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pocc/pre-commit-hooks
|
||||||
|
rev: master
|
||||||
|
hooks:
|
||||||
|
- id: clang-format
|
||||||
|
args:
|
||||||
|
- -i
|
||||||
|
- repo: https://github.com/prettier/prettier
|
||||||
|
rev: master
|
||||||
|
hooks:
|
||||||
|
- id: prettier
|
|
@ -81,6 +81,11 @@ documentation to areas not currently covered are greatly appreciated.
|
||||||
- To get started, from the `docs/` directory, run `npm ci` and then `npm start`.
|
- To get started, from the `docs/` directory, run `npm ci` and then `npm start`.
|
||||||
- Enhancements should be submitted as pull requests to the `main` branch of ZMK.
|
- Enhancements should be submitted as pull requests to the `main` branch of ZMK.
|
||||||
|
|
||||||
|
### Formatting
|
||||||
|
|
||||||
|
ZMK uses `prettier` to format documentation files. You can run prettier with `npm run prettier:format`.
|
||||||
|
You can setup git to run prettier automatically when you commit by installing the pre-commit hooks: `pip3 install pre-commit`, `pre-commit install`.
|
||||||
|
|
||||||
## Code Contributions
|
## Code Contributions
|
||||||
|
|
||||||
### Development Setup
|
### Development Setup
|
||||||
|
@ -95,6 +100,8 @@ ZMK uses `clang-format` to ensure consist formatting for our source code. Before
|
||||||
changes, make sure you've manually run `clang-format`, or have your IDE configured to auto-format
|
changes, make sure you've manually run `clang-format`, or have your IDE configured to auto-format
|
||||||
on save.
|
on save.
|
||||||
|
|
||||||
|
You can setup git to run `clang-format` automatically when you commit by installing the pre-commit hooks: `pip3 install pre-commit`, `pre-commit install`.
|
||||||
|
|
||||||
### Commit Messages
|
### Commit Messages
|
||||||
|
|
||||||
The ZMK project is working towards, but not yet enforcing, the use of
|
The ZMK project is working towards, but not yet enforcing, the use of
|
||||||
|
|
Loading…
Reference in a new issue