Skip to content

Commit 5c36553

Browse files
committed
docs: reorganize testing documentation and add file placement guidelines
- Add comprehensive testing guide to Sphinx docs (docs/source/development/testing.rst) - Add contributing guide to Sphinx docs (docs/source/development/contributing.rst) - Update CLAUDE.md with file placement guidelines to prevent root clutter - Update DEVELOPMENT.md to reference new Sphinx documentation - Add .lad/tmp/ to .gitignore for LAD session artifacts - Integrate development docs into main Sphinx documentation index This improves documentation organization and prevents temporary files from cluttering the project root. LAD-generated analysis files now go to .lad/tmp/, while permanent documentation goes to docs/source/. Testing documentation now properly integrated with Sphinx for better searchability and navigation.
1 parent a3dd9f9 commit 5c36553

File tree

7 files changed

+496
-0
lines changed

7 files changed

+496
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ sandbox/
1616
venv/
1717
venvs/
1818
.DS_Store
19+
.lad/tmp/

CLAUDE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
44

5+
For comprehensive development information, see `DEVELOPMENT.md` and the developer documentation in `docs/source/development/`.
6+
57
## Build/Test Commands
68
- Run tests: `tox -e py3` but should also work with just `python -m pytest dandi` if in a venv
79
- Tests which require an instance of the archive, would use a fixture to start on using docker-compose.
@@ -35,3 +37,21 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
3537
## Documentation
3638
- Keep docstrings updated when changing function signatures
3739
- CLI help text should be clear and include examples where appropriate
40+
- Documentation files go in `docs/source/` (Sphinx RST format)
41+
- Testing documentation: See `.lad/tmp/TESTING_BEST_PRACTICES.md` and `.lad/tmp/TESTING_GUIDELINES.md`
42+
43+
## File Placement Guidelines
44+
**IMPORTANT**: Do not create analysis, baseline, or temporary files in the project root.
45+
46+
Proper file locations:
47+
- **LAD session artifacts**: `.lad/tmp/` (test baselines, analysis reports, session notes)
48+
- **Documentation**: `docs/source/` (must be RST format for Sphinx)
49+
- **Test data**: `dandi/tests/data/`
50+
- **Development notes**: `.lad/tmp/notes/` or personal notes outside the repo
51+
- **Temporary scratch files**: Use system temp dir or `.lad/tmp/scratchpad/`
52+
53+
Examples of files that should NOT be in project root:
54+
-`test_execution_baseline.md` → ✅ `.lad/tmp/test_execution_baseline.md`
55+
-`analysis_report.md` → ✅ `.lad/tmp/analysis_report.md`
56+
-`session_notes.txt` → ✅ `.lad/tmp/notes/session_notes.txt`
57+
-`TESTING_GUIDE.md` → ✅ `docs/source/development/testing.rst` (converted to RST)

DEVELOPMENT.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# DANDI Client Development
22

3+
> **Note**: For comprehensive developer documentation including testing guides and contribution workflows, see `docs/source/development/` (built Sphinx docs) or the [online documentation](https://dandi.readthedocs.io/).
4+
35
## Development environment
46

57
Assuming that you have `python3` (and virtualenv) installed, the fastest
@@ -159,3 +161,19 @@ organized by label. `auto` recognizes the following PR labels:
159161
- `tests` — for changes to tests
160162
- `dependencies` — for updates to dependency versions
161163
- `performance` — for performance improvements
164+
165+
## Developer Documentation
166+
167+
For additional developer resources, see the Sphinx documentation in `docs/source/development/`:
168+
169+
- **Testing Guide** (`docs/source/development/testing.rst`) - Comprehensive testing practices, patterns, and Docker setup
170+
- **Contributing Guide** (`docs/source/development/contributing.rst`) - Quick reference for contribution workflow
171+
172+
To build the documentation locally:
173+
```bash
174+
cd docs
175+
make html
176+
open build/html/index.html # or xdg-open on Linux
177+
```
178+
179+
Or view online at [dandi.readthedocs.io](https://dandi.readthedocs.io/)
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
.. _contributing:
2+
3+
**********************
4+
Contributing Guide
5+
**********************
6+
7+
Thank you for your interest in contributing to dandi-cli!
8+
9+
This document provides a quick overview. For comprehensive details, see ``DEVELOPMENT.md`` in the repository root.
10+
11+
Getting Started
12+
===============
13+
14+
1. **Fork and clone** the repository
15+
2. **Set up development environment**:
16+
17+
.. code-block:: bash
18+
19+
# Using uv (recommended)
20+
uv venv
21+
source .venv/bin/activate
22+
uv pip install -e ".[devel]"
23+
24+
# Or using traditional venv
25+
python -m venv venvs/dev3
26+
source venvs/dev3/bin/activate
27+
pip install -e ".[devel]"
28+
29+
3. **Install pre-commit hooks**:
30+
31+
.. code-block:: bash
32+
33+
pre-commit install
34+
35+
4. **Run tests** to verify setup:
36+
37+
.. code-block:: bash
38+
39+
pytest dandi/tests/test_utils.py -v
40+
41+
42+
Development Workflow
43+
====================
44+
45+
1. **Create a branch** for your feature or bugfix
46+
2. **Write tests first** (TDD approach recommended)
47+
3. **Implement your changes**
48+
4. **Run tests and linters**:
49+
50+
.. code-block:: bash
51+
52+
# Run tests
53+
pytest dandi -x
54+
55+
# Run linters
56+
tox -e lint,typing
57+
58+
5. **Commit your changes**:
59+
60+
.. code-block:: bash
61+
62+
git add .
63+
git commit -m "feat: add new feature"
64+
65+
If pre-commit hooks modify files, just commit again.
66+
67+
6. **Push and create a Pull Request**
68+
69+
70+
Code Style
71+
==========
72+
73+
- **Formatter**: Black (line length 100)
74+
- **Import sorting**: isort (profile="black")
75+
- **Type annotations**: Required for new code
76+
- **Docstrings**: NumPy style for public APIs
77+
- **Naming**:
78+
- Classes: ``CamelCase``
79+
- Functions/variables: ``snake_case``
80+
- Exceptions: End with "Error" (e.g., ``ValidateError``)
81+
82+
83+
Testing Requirements
84+
====================
85+
86+
- All new features must include tests
87+
- Bug fixes should include regression tests
88+
- Mark AI-generated tests with ``@pytest.mark.ai_generated``
89+
- New pytest markers must be registered in ``tox.ini``
90+
91+
See :doc:`testing` for comprehensive testing guidelines.
92+
93+
94+
Pull Request Guidelines
95+
=======================
96+
97+
- **Title**: Use conventional commit format (``feat:``, ``fix:``, ``docs:``, etc.)
98+
- **Description**: Explain what and why, not how
99+
- **Tests**: Ensure all tests pass
100+
- **Documentation**: Update docstrings and docs as needed
101+
- **Changelog**: Will be auto-generated from PR labels
102+
103+
104+
Code Review Process
105+
===================
106+
107+
1. CI must pass (tests, linting, type checking)
108+
2. At least one maintainer approval required
109+
3. Address review feedback
110+
4. Squash commits if requested
111+
5. Maintainer will merge when ready
112+
113+
114+
Communication
115+
=============
116+
117+
- **Issues**: Report bugs and request features on GitHub
118+
- **Discussions**: Use GitHub Discussions for questions
119+
- **Pull Requests**: For code contributions
120+
121+
122+
Additional Resources
123+
====================
124+
125+
- ``DEVELOPMENT.md`` - Detailed development guide
126+
- ``CLAUDE.md`` - Project-specific guidelines for AI assistants
127+
- :doc:`testing` - Comprehensive testing guide
128+
- `Contributing to Open Source <https://opensource.guide/how-to-contribute/>`_ - General guide

docs/source/development/index.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.. _development:
2+
3+
*******************
4+
Development Guide
5+
*******************
6+
7+
This section contains guides for contributing to dandi-cli.
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
12+
testing
13+
contributing
14+
15+
16+
Testing Guide
17+
=============
18+
19+
See :doc:`testing` for comprehensive testing guidelines and best practices.
20+
21+
Contributing
22+
============
23+
24+
See :doc:`contributing` for general contribution guidelines.

0 commit comments

Comments
 (0)