|
| 1 | +# Contributing to AT Python Template |
| 2 | + |
| 3 | +We welcome your contributions! Whether it's reporting a bug, discussing ideas, submitting fixes, or proposing new features, we appreciate your input. |
| 4 | + |
| 5 | +## We Develop with GitHub |
| 6 | +We use GitHub to host code, track issues, and review pull requests. |
| 7 | + |
| 8 | +## Follow the GitHub Flow |
| 9 | +All changes should be proposed through pull requests: |
| 10 | + |
| 11 | +1. Fork the repository and create your branch from `master`. |
| 12 | +2. If you've added new functionality, include tests. |
| 13 | +3. Update the documentation if there are any changes to APIs or usage. |
| 14 | +4. Ensure all tests pass. |
| 15 | +5. Verify that your code adheres to linting and formatting standards. |
| 16 | +6. Submit your pull request! |
| 17 | + |
| 18 | +## Code License |
| 19 | +When you submit code changes, you agree that your contributions will be licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). |
| 20 | + |
| 21 | +## Reporting Issues |
| 22 | +Please use [GitHub Issues](https://github.com/at-gmbh/at-python-template/issues) to report bugs and suggest improvements. Make sure to include: |
| 23 | + |
| 24 | +- A brief summary of the issue |
| 25 | +- Steps to reproduce the problem |
| 26 | +- Expected behavior |
| 27 | +- Actual behavior |
| 28 | +- Additional notes or related references |
| 29 | + |
| 30 | +## Coding Standards |
| 31 | + |
| 32 | +- Use 4 spaces per indentation level |
| 33 | +- Maximum line length is 120 characters |
| 34 | +- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guidelines |
| 35 | +- Use [Ruff](https://github.com/charliermarsh/ruff) for formatting and linting (applied automatically with pre-commit hooks, or manually if needed) |
| 36 | +- Include type hints as per [PEP 484](https://peps.python.org/pep-0484/) |
| 37 | +- Use Google-style docstrings |
| 38 | +- Ensure code is clean, readable, and maintainable |
| 39 | + |
| 40 | +## Imports |
| 41 | + |
| 42 | +- Order imports as follows: |
| 43 | + 1. Future imports |
| 44 | + 2. Standard library imports |
| 45 | + 3. Third-party imports |
| 46 | + 4. Local imports |
| 47 | +- Avoid wildcard imports |
| 48 | +- Use absolute imports unless relative imports simplify the code |
| 49 | + |
| 50 | +## Comments |
| 51 | + |
| 52 | +- Write comments in English |
| 53 | +- Explain the intention behind code, not what the code does |
| 54 | +- Use full sentences with proper capitalization and punctuation |
| 55 | + |
| 56 | +## Naming Conventions |
| 57 | + |
| 58 | +- Variables and functions: `lower_case_with_underscores` |
| 59 | +- Classes: `CapWords` |
| 60 | +- Constants: `ALL_CAPS_WITH_UNDERSCORES` |
| 61 | +- Modules: `alllowercase` |
| 62 | + |
| 63 | +## Setting Up for Development |
| 64 | + |
| 65 | +1. Install dependencies using `poetry install`. |
| 66 | +2. Run tests with `pytest tests`. |
| 67 | +3. Use `pre-commit install` to set up pre-commit hooks. This ensures that Ruff and other checks run before each commit. |
| 68 | + |
| 69 | +## Testing |
| 70 | +We use [pytest](https://docs.pytest.org/) for running tests. Ensure that all tests pass before submitting a pull request. |
| 71 | + |
| 72 | +## Additional Resources |
| 73 | + |
| 74 | +- [Cookiecutter Documentation](https://cookiecutter.readthedocs.io/) |
| 75 | +- [GitHub Flow Guide](https://guides.github.com/introduction/flow/) |
| 76 | +- [Python Packaging Guide](https://packaging.python.org/) |
| 77 | +- [Poetry Documentation](https://python-poetry.org/) |
| 78 | +- [Ruff Documentation](https://docs.astral.sh/ruff/) |
| 79 | +- [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) |
| 80 | + |
| 81 | +Thank you for your contributions! |
0 commit comments