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: README.md
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,66 @@ This is part of [**a GSoC (Google Summer of Code) 2025** project](https://summer
145
145
146
146
The lead developer is [axif0](https://github.com/axif0), mentored by the developers of the CBRAIN project.
147
147
148
+
### Developer Setup
149
+
150
+
Install the CLI in editable mode with the development tools:
151
+
152
+
```bash
153
+
python3 -m venv venv
154
+
source venv/bin/activate
155
+
pip install -e ".[dev]"
156
+
```
157
+
158
+
This project is a pure Python CLI. There is no separate compile or build step for normal development; installing in editable mode is enough to run the local `cbrain` command.
159
+
160
+
### Linting And Formatting
161
+
162
+
Ruff is used for linting and formatting:
163
+
164
+
```bash
165
+
ruff check .
166
+
ruff format .
167
+
```
168
+
169
+
To check formatting without changing files:
170
+
171
+
```bash
172
+
ruff format --check .
173
+
```
174
+
175
+
### Pre-Commit Hooks
176
+
177
+
The repository includes a `.pre-commit-config.yaml`. Install the hooks with:
178
+
179
+
```bash
180
+
pre-commit install
181
+
```
182
+
183
+
The hooks currently:
184
+
185
+
- trim trailing whitespace;
186
+
- ensure files end with a newline;
187
+
- check YAML syntax;
188
+
- check Markdown links;
189
+
- run `ruff --fix`;
190
+
- run `ruff format`.
191
+
192
+
The generated capture fixture `capture_tests/expected_captures.txt` is excluded from whitespace and Ruff hooks because exact captured output is intentional there.
193
+
194
+
To run the hooks manually:
195
+
196
+
```bash
197
+
pre-commit run --all-files
198
+
```
199
+
200
+
### Tests
201
+
202
+
The existing test suite is based on capture tests in `capture_tests/`. These are shell-based CLI output regression tests: they run commands from `capture_tests/cbrain_cli_commands` and compare the captured terminal output against `capture_tests/expected_captures.txt`.
203
+
204
+
Capture tests require a local CBRAIN test server on `localhost:3000` with the expected test database seed. The GitHub Actions workflow sets this up by checking out the CBRAIN server repository at https://github.com/aces/cbrain.
205
+
206
+
When command output intentionally changes, update `capture_tests/expected_captures.txt`. When behavior changes without intended output changes, prefer adding focused unit tests where possible.
207
+
148
208
### Continuous Integration
149
209
150
210
Continuous Integration (CI) tests and framework were initially configured by P. Rioux, providing automated validation of the codebase. This infrastructure follows best open source practices and ensures code quality through automated testing.
0 commit comments