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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,55 @@ When creating a PR, use the following process.
52
52
> By creating a PR, you agree to allow your contribution to be licensed under the
53
53
> terms of the LICENSE.txt file.
54
54
55
+
### Pre-commit hooks
56
+
57
+
This repository uses [pre-commit](https://pre-commit.com/) to automatically format code and generate documentation. When you commit changes to plugin files, the hooks will:
Install pre-commit hooks after cloning the repository:
66
+
67
+
```bash
68
+
# Activate your virtual environment
69
+
source venv/bin/activate
70
+
71
+
# Install pre-commit hooks
72
+
pre-commit install
73
+
```
74
+
75
+
#### Usage
76
+
77
+
The hooks run automatically when you commit.
78
+
79
+
```bash
80
+
# First commit attempt - hooks run and may modify files
81
+
git commit -m "Add new plugin feature"
82
+
83
+
# If hooks modified files, stage them and commit again
84
+
git add .
85
+
git commit -m "Add new plugin feature"
86
+
```
87
+
88
+
You can also run hooks manually:
89
+
90
+
```bash
91
+
# Run all hooks on all files
92
+
pre-commit run --all-files
93
+
94
+
# Run a specific hook
95
+
pre-commit run generate-plugin-docs --all-files
96
+
```
97
+
98
+
#### Plugin documentation
99
+
100
+
The `generate-plugin-docs` hook automatically regenerates `docs/PLUGIN_DOC.md` whenever plugin files in `nodescraper/plugins/inband/` are modified. This ensures the documentation stays in sync with the code.
101
+
102
+
If plugins are added or modified, the documentation will be automatically updated on the next commit.
0 commit comments