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: docs/sdk_developers/setup.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,42 @@ Optional: To install all available extras (useful full-matrix testing):
174
174
uv sync --dev --all-extras
175
175
```
176
176
177
+
## Pre-Commit Tool Setup
178
+
179
+
To maintain high code quality and security, this repository uses `re-commit` hooks. These hooks automatically run checks (like `Ruff` for linting and `Gitleaks` for security) every time you attempt to commit code.
180
+
181
+
**Option 1: Using `uv` (Recommended)**
182
+
183
+
`uv` is recommended because it manages pre-commit within your project’s locked environment, ensuring your local linting matches the CI exactly.
184
+
185
+
1.**Install the git hooks:**
186
+
```bash
187
+
uv run pre-commit install
188
+
```
189
+
190
+
2.**Verify your setup (Optional):**
191
+
```bash
192
+
uv run pre-commit run --all-files
193
+
```
194
+
195
+
**Option 2: Using pip**
196
+
197
+
If you are using a standard virtual environment:
198
+
199
+
1.**Install the package:**
200
+
```bash
201
+
pip install pre-commit
202
+
```
203
+
204
+
2.**Install the git hooks:**
205
+
```bash
206
+
pre-commit install
207
+
```
208
+
209
+
Once installed, `git commit` will automatically trigger the checks.
210
+
- If they **pass**: Your commit is created normally.
211
+
- If they **fail**: The hooks will often fix the files for you (e.g., `Ruff` reformatting). Simply `git add` the changed files and commit again.
212
+
177
213
## Generate Protocol Buffers
178
214
179
215
The SDK uses protocol buffers to communicate with the Hedera network. Generate the Python code from the protobuf definitions:
0 commit comments