Skip to content

Commit ef15681

Browse files
committed
Reformatted contributing doc
1 parent 04bfdad commit ef15681

1 file changed

Lines changed: 28 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,21 @@ This project adheres to a code of conduct that we expect all contributors to fol
3939
### Setting Up Your Development Environment
4040

4141
1. **Fork and clone the repository:**
42+
4243
```bash
4344
git clone https://github.com/YOUR_USERNAME/hed-python.git
4445
cd hed-python
4546
```
4647

4748
2. **Create a virtual environment (recommended):**
49+
4850
```bash
4951
python -m venv venv
5052
source venv/bin/activate # On Windows: venv\Scripts\activate
5153
```
5254

5355
3. **Install in development mode:**
56+
5457
```bash
5558
pip install -e .
5659
pip install -r requirements.txt
@@ -59,6 +62,7 @@ This project adheres to a code of conduct that we expect all contributors to fol
5962
```
6063

6164
4. **Run tests to verify setup:**
65+
6266
```bash
6367
python -m unittest discover tests
6468
```
@@ -77,31 +81,35 @@ This project adheres to a code of conduct that we expect all contributors to fol
7781
We use several tools to maintain code quality:
7882

7983
- **black:** For automatic code formatting
84+
8085
```bash
8186
# Check if code is formatted correctly
8287
black --check .
83-
88+
8489
# Automatically format all code
8590
black .
86-
91+
8792
# Format specific files or directories
8893
black hed/ tests/
89-
94+
9095
# Windows: Use --workers 1 if you encounter file I/O errors
9196
black --workers 1 .
9297
```
9398

9499
- **ruff:** For linting, style checking, and import sorting
100+
95101
```bash
96102
ruff check hed/ tests/
97103
```
98-
104+
99105
To automatically fix issues:
106+
100107
```bash
101108
ruff check --fix hed/ tests/
102109
```
103110

104111
- **codespell:** For spell checking
112+
105113
```bash
106114
codespell
107115
```
@@ -113,6 +121,7 @@ We use several tools to maintain code quality:
113121
- Provide examples for complex functionality
114122

115123
Example docstring:
124+
116125
```python
117126
def validate_hed_string(hed_string, schema)->list[dict]:
118127
"""Validate a HED string against a schema.
@@ -149,6 +158,7 @@ def validate_hed_string(hed_string, schema)->list[dict]:
149158
- Include edge cases
150159

151160
Example test:
161+
152162
```python
153163
import unittest
154164
from hed import HedString, load_schema
@@ -175,16 +185,19 @@ if __name__ == '__main__':
175185
### Running Tests
176186

177187
Run all tests:
188+
178189
```bash
179190
python -m unittest discover tests
180191
```
181192

182193
Run specific test file:
194+
183195
```bash
184196
python -m unittest tests/models/test_hed_string.py
185197
```
186198

187199
Run specific test case:
200+
188201
```bash
189202
python -m unittest tests.models.test_hed_string.TestHedString.test_constructor
190203
```
@@ -194,17 +207,20 @@ python -m unittest tests.models.test_hed_string.TestHedString.test_constructor
194207
### Before Submitting
195208

196209
1. **Update your branch:**
210+
197211
```bash
198212
git fetch origin
199213
git rebase origin/main
200214
```
201215

202216
2. **Run all tests:**
217+
203218
```bash
204219
python -m unittest discover tests
205220
```
206221

207222
3. **Check code style:**
223+
208224
```bash
209225
ruff check hed/ tests/
210226
```
@@ -214,27 +230,31 @@ python -m unittest tests.models.test_hed_string.TestHedString.test_constructor
214230
### Submitting a Pull Request
215231

216232
1. **Create a feature branch:**
233+
217234
```bash
218235
git checkout -b feature/your-feature-name
219236
```
220237

221238
2. **Make your changes** with clear, focused commits
222239

223240
3. **Write descriptive commit messages:**
241+
224242
```
225243
Add validation for temporal extent
226-
244+
227245
- Implement temporal extent validation logic
228246
- Add unit tests for temporal validation
229247
- Update documentation with temporal examples
230248
```
231249

232250
4. **Push to your fork:**
251+
233252
```bash
234253
git push origin feature/your-feature-name
235254
```
236255

237256
5. **Open a Pull Request** on GitHub:
257+
238258
- Target the `main` branch
239259
- Fill out the PR template completely
240260
- Link related issues
@@ -267,7 +287,8 @@ Create an issue with:
267287
7. **Error messages** or stack traces
268288

269289
Example:
270-
```markdown
290+
291+
````markdown
271292
## Bug: Schema validation fails with custom schema
272293

273294
**Environment:**
@@ -296,7 +317,7 @@ issues = hed.validate(schema) # KeyError here
296317
KeyError: 'Event'
297318
at line 123 in validator.py
298319
\```
299-
```
320+
````
300321

301322
## Suggesting Enhancements
302323

0 commit comments

Comments
 (0)