|
1 | | -# Contributing to the Project |
| 1 | +# Contributing to FlixOpt |
2 | 2 |
|
3 | | -We warmly welcome contributions from the community! This guide will help you get started with contributing to our project. |
| 3 | +We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or sharing examples, your contributions are valuable. |
| 4 | + |
| 5 | +## Ways to Contribute |
| 6 | + |
| 7 | +### 🐛 Report Issues |
| 8 | +Found a bug or have a feature request? Please [open an issue](https://github.com/flixOpt/flixopt/issues) on GitHub. |
| 9 | + |
| 10 | +When reporting issues, please include: |
| 11 | +- A clear description of the problem |
| 12 | +- Steps to reproduce the issue |
| 13 | +- Expected vs. actual behavior |
| 14 | +- Your environment (OS, Python version, FlixOpt version) |
| 15 | +- Minimal code example if applicable |
| 16 | + |
| 17 | +### 💡 Share Examples |
| 18 | +Help others learn FlixOpt by contributing examples: |
| 19 | +- Real-world use cases |
| 20 | +- Tutorial notebooks |
| 21 | +- Integration examples with other tools |
| 22 | +- Add them to the `examples/` directory |
| 23 | + |
| 24 | +### 📖 Improve Documentation |
| 25 | +Documentation improvements are always welcome: |
| 26 | +- Fix typos or clarify existing docs |
| 27 | +- Add missing documentation |
| 28 | +- Translate documentation |
| 29 | +- Improve code comments |
| 30 | + |
| 31 | +### 🔧 Submit Code Contributions |
| 32 | +Ready to contribute code? Great! See the sections below for setup and guidelines. |
| 33 | + |
| 34 | +--- |
4 | 35 |
|
5 | 36 | ## Development Setup |
6 | | -1. Clone the repository `git clone https://github.com/flixOpt/flixopt.git` |
7 | | -2. Install the development dependencies `pip install -e ".[full, dev]"` |
8 | | -3. Install pre-commit hooks `pre-commit install` (one-time setup) |
9 | | -4. Run `pytest` to ensure your code passes all tests |
10 | 37 |
|
11 | | -## Code Quality |
12 | | -We use [Ruff](https://github.com/astral-sh/ruff) for linting and formatting. After the one-time setup above, **code quality checks run automatically on every commit**. |
| 38 | +### Getting Started |
| 39 | +1. Fork and clone the repository: |
| 40 | + ```bash |
| 41 | + git clone https://github.com/flixOpt/flixopt.git |
| 42 | + cd flixopt |
| 43 | + ``` |
13 | 44 |
|
14 | | -To run manually: |
15 | | -- `ruff check --fix .` to check and fix linting issues |
16 | | -- `ruff format .` to format code or |
17 | | -- `pre-commit run` or `pre-commit run --all-files` to trigger all checks |
| 45 | +2. Install development dependencies: |
| 46 | + ```bash |
| 47 | + pip install -e ".[full, dev]" |
| 48 | + ``` |
18 | 49 |
|
19 | | -## Documentation (Optional) |
| 50 | +3. Set up pre-commit hooks (one-time setup): |
| 51 | + ```bash |
| 52 | + pre-commit install |
| 53 | + ``` |
| 54 | + |
| 55 | +4. Verify your setup: |
| 56 | + ```bash |
| 57 | + pytest |
| 58 | + ``` |
| 59 | + |
| 60 | +### Working with Documentation |
20 | 61 | FlixOpt uses [mkdocs](https://www.mkdocs.org/) to generate documentation. |
| 62 | + |
21 | 63 | To work on documentation: |
22 | 64 | ```bash |
23 | 65 | pip install -e ".[docs]" |
24 | 66 | mkdocs serve |
25 | 67 | ``` |
26 | 68 | Then navigate to http://127.0.0.1:8000/ |
27 | 69 |
|
28 | | -## Testing |
29 | | -- `pytest` to run the test suite |
30 | | - |
31 | 70 | --- |
32 | | -# Best practices |
33 | 71 |
|
34 | | -## Coding Guidelines |
| 72 | +## Code Quality Standards |
| 73 | + |
| 74 | +### Automated Checks |
| 75 | +We use [Ruff](https://github.com/astral-sh/ruff) for linting and formatting. After the one-time setup above, **code quality checks run automatically on every commit**. |
| 76 | + |
| 77 | +### Manual Checks |
| 78 | +To run checks manually: |
| 79 | +- `ruff check --fix .` - Check and fix linting issues |
| 80 | +- `ruff format .` - Format code |
| 81 | +- `pre-commit run --all-files` - Run all pre-commit checks |
| 82 | + |
| 83 | +### Testing |
| 84 | +- `pytest` - Run the test suite |
| 85 | +- Ensure all tests pass before submitting a PR |
35 | 86 |
|
36 | | -- Follow PEP 8 style guidelines |
37 | | -- Write clear, commented code |
38 | | -- Include type hints |
| 87 | +### Coding Guidelines |
| 88 | +- Follow [PEP 8](https://pep8.org/) style guidelines |
| 89 | +- Write clear, self-documenting code with helpful comments |
| 90 | +- Include type hints for function signatures |
39 | 91 | - Create or update tests for new functionality |
40 | | -- Ensure 100% test coverage for new code |
| 92 | +- Aim for 100% test coverage for new code |
| 93 | + |
| 94 | +--- |
| 95 | + |
| 96 | +## Workflow |
| 97 | + |
| 98 | +### Branches & Pull Requests |
| 99 | +1. Create a feature branch from `main`: |
| 100 | + ```bash |
| 101 | + git checkout -b feature/your-feature-name |
| 102 | + ``` |
| 103 | + |
| 104 | +2. Make your changes and commit them with clear messages |
| 105 | + |
| 106 | +3. Push your branch and open a Pull Request |
| 107 | + |
| 108 | +4. Ensure all CI checks pass |
| 109 | + |
| 110 | +### Branch Naming |
| 111 | +- Features: `feature/feature-name` |
| 112 | +- Bug fixes: `fix/bug-description` |
| 113 | +- Documentation: `docs/what-changed` |
| 114 | + |
| 115 | +### Commit Messages |
| 116 | +- Use clear, descriptive commit messages |
| 117 | +- Start with a verb (Add, Fix, Update, Remove, etc.) |
| 118 | +- Keep the first line under 72 characters |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +## Releases |
| 123 | + |
| 124 | +We follow **Semantic Versioning** (MAJOR.MINOR.PATCH). Releases are created manually from the `main` branch by maintainers. |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +## Questions? |
| 129 | + |
| 130 | +If you have questions or need help, feel free to: |
| 131 | +- Open a discussion on GitHub |
| 132 | +- Ask in an issue |
| 133 | +- Reach out to the maintainers |
41 | 134 |
|
42 | | -## Branches & Releases |
43 | | -New features should be branched from `main` into `feature/*` |
44 | | -As stated, we follow **Semantic Versioning**. Releases are created manually from the `main` branch. |
| 135 | +Thank you for contributing to FlixOpt! |
0 commit comments