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
docs: Update contributing guidelines and development workflow (#24)
* chore: add GitHub issue templates and config
* docs: update contributing guidelines, move tests guidance to a new doc, linked
Move Code Style, Testing, and Documentation sections up.
Add links to ensure new contributors can understand code documentation styles
Explain Taskfile and reference commands in Taskfile when possible
* test: bump up coverage threshold to 80, to match original Testing target
"Maintain test coverage above 80%"
- Use [type hints](https://docs.python.org/3/library/typing.html) for better code clarity and IDE support
7
+
- Write docstrings for all public methods following [PEP 257](https://peps.python.org/pep-0257/) conventions
8
+
- Keep functions focused and small
9
+
10
+
## Documentation
11
+
12
+
- Update documentation for new features
13
+
- Include [docstrings](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) in code (Google style preferred)
14
+
- Update example usage in README.md
15
+
- Add type hints to function signatures
16
+
17
+
## Making Changes
18
+
19
+
1. Review [open issues](https://github.com/rafaelherik/tfsumpy/issues) and [pull requests](https://github.com/rafaelherik/tfsumpy/pulls) to see if there is any related work that's already in progress
20
+
2. Get or update your own copy of the project to work with
21
+
3. Write new and/or update existing tests for your changes
This project uses [Task](https://taskfile.dev/) to run set up, and run linting, and testing tasks consistently with how they are run in CI. Start by making sure you have [Task](https://taskfile.dev/) installed.
41
+
42
+
Running the `task install`command will create a local virtual environment, install dev requirements and then execute the individual tools. Running these commands in the [Taskfile](Taskfile.yml) guarantees that everyone, including CI workflows, uses the same versions and settings.
43
+
44
+
```bash
45
+
task install
46
+
```
16
47
17
48
## Development Process
18
49
@@ -22,25 +53,55 @@ pip install -e ".[dev]"
22
53
git checkout -b feature/your-feature-name
23
54
```
24
55
25
-
### Running Tests
56
+
### Testing
57
+
58
+
- **Unit Tests**: Required for all new features and bug fixes
59
+
- Follow our [Testing Guide](tests.md) for best practices
60
+
- Use [pytest](https://docs.pytest.org/)-style tests with `assert` statements
61
+
- Maintain test coverage above 80%
62
+
- Run tests with `task test` (executes `pytest` with coverage)
63
+
64
+
- **Test-Driven Development (TDD)**:
65
+
- Write tests first, then implementation
66
+
- Follow the [TDD workflow](https://realpython.com/test-driven-development-python/)
67
+
- Keep tests focused and fast
68
+
69
+
- **Test Types**:
70
+
- Unit tests for individual functions/classes
71
+
- Integration tests for component interactions
72
+
- See [Testing Guide](tests.md) for detailed patterns
73
+
74
+
### Linting
75
+
76
+
Linting and static analysis are automated in GitHub Actions. To help you get an approval for your pull request, you'll need to have all Actions workflow checks pass. To run the same tools locally you can use the [Taskfile](Taskfile.yml) to achieve the same results. First make sure you have the [Task](https://taskfile.dev/) runner [installed](https://taskfile.dev/#/installation).
26
77
27
78
```bash
28
-
pytest
79
+
cd tfsumpy
80
+
# Run ruff, mypy and bandit (fails on any issues)
81
+
task lint
82
+
83
+
# Optionally, auto-fix style issues detected by ruff
84
+
task lint-fix
29
85
```
30
86
31
-
### Running Linting
87
+
The Taskfile will create a local virtual environment if needed, install all dev requirements and then execute the individual tools. Running the tasks guarantees that everyone uses the same versions and settings.
88
+
89
+
### Running Tests
90
+
91
+
Automated tests run in GitHub Actions. To help you get an approval for your pull request, you'll need to have all Actions workflow checks pass. To run the same tests locally you can use the [Taskfile](Taskfile.yml) to achieve the same results. First make sure you have the [Task](https://taskfile.dev/) runner [installed](https://taskfile.dev/#/installation).
32
92
33
93
```bash
34
-
pylint tfsumpy
35
-
mypy tfsumpy
94
+
# Run pytest with coverage threshold enforcement (mirrors CI)
95
+
task test
36
96
```
37
97
38
-
### Making Changes
98
+
This task sets up the virtual-env if necessary, installs all dev dependencies, then executes
0 commit comments