You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[docs]: add contribuing guide and add hooks install (#1613)
* [feat]: update kt-kernel hooks and add contribution guide
* [docs]: add contributing guide
* [style]: format the python file and cpp file in kt-kernel
Your commit message must follow Conventional Commits (https://www.conventionalcommits.org/) and your code should be formatted. The Git hooks will do most of the work automatically:
4
+
5
+
### Tool Requirements
6
+
7
+
You need a recent `clang-format` (>= 18). In a conda environment you can install:
8
+
9
+
```shell
10
+
conda install -c conda-forge clang-format=18
11
+
```
12
+
13
+
If you previously configured with an older version, remove the build directory and reconfigure:
14
+
15
+
```shell
16
+
rm -rf kt-kernel/build
17
+
```
18
+
19
+
Install `black` for Python formatting:
20
+
21
+
```shell
22
+
conda install black
23
+
```
24
+
25
+
### Install hook:
26
+
```shell
27
+
bash kt-kernel/scripts/install-git-hooks.sh
28
+
#or just cmake the kt-kernel
29
+
cmake -S kt-kernel -B kt-kernel/build
30
+
```
31
+
32
+
There are manual commands if you need format.
33
+
34
+
```shell
35
+
cmake -S kt-kernel -B kt-kernel/build
36
+
cmake --build kt-kernel/build --target format
37
+
```
38
+
39
+
## Developer Note
40
+
41
+
Formatting and commit message rules are enforced by Git hooks. After installing `clang-format` and `black`, just commit normally—the hooks will run formatting for you.
42
+
43
+
> [!NOTE]
44
+
> If formatting modifies files, the commit is aborted after staging those changes. Review them and run `git commit` again. Repeat until no further formatting changes appear.
message(FATAL_ERROR "Required script 'scripts/install-git-hooks.sh' not found in kt-kernel; cannot install hooks.")
97
110
endif()
98
111
else()
99
-
message(FATAL_ERROR "Repository appears to be a git repo but required script 'scripts/install-git-hooks.sh' was not found. Please ensure hooks installer is present.")
0 commit comments