|
1 | 1 | # Contributing to HTTP Agent |
2 | 2 |
|
3 | | -Thank you for your interest in contributing to HTTP Agent! We welcome contributions of all kinds. |
| 3 | +Thank you for your interest in contributing to HTTP Agent! We welcome contributions from the community. |
4 | 4 |
|
5 | 5 | ## How to Contribute |
6 | 6 |
|
7 | 7 | ### Reporting Bugs |
8 | | -- Use the GitHub issue tracker |
9 | | -- Follow the bug report template |
10 | | -- Include logs with debug logging enabled |
11 | | -- Provide clear reproduction steps |
12 | | - |
13 | | -### Requesting Features |
14 | | -- Use the GitHub issue tracker |
15 | | -- Follow the feature request template |
16 | | -- Explain the use case clearly |
17 | | -- Consider backward compatibility |
18 | | - |
19 | | -### Code Contributions |
20 | | - |
21 | | -#### Development Setup |
22 | | -1. Fork the repository |
23 | | -2. Clone your fork |
24 | | -3. Install development dependencies: |
| 8 | + |
| 9 | +If you find a bug, please create an issue on GitHub with the following information: |
| 10 | + |
| 11 | +- **Description**: A clear description of the bug |
| 12 | +- **Steps to Reproduce**: Detailed steps to reproduce the issue |
| 13 | +- **Expected Behavior**: What you expected to happen |
| 14 | +- **Actual Behavior**: What actually happened |
| 15 | +- **Environment**: |
| 16 | + - Home Assistant version |
| 17 | + - HTTP Agent version |
| 18 | + - Browser (if UI-related) |
| 19 | +- **Logs**: Relevant error messages or logs from Home Assistant |
| 20 | + |
| 21 | +### Suggesting Enhancements |
| 22 | + |
| 23 | +We welcome feature requests! Please create an issue with: |
| 24 | + |
| 25 | +- **Description**: A clear description of the enhancement |
| 26 | +- **Use Case**: Why this feature would be useful |
| 27 | +- **Proposed Solution**: If you have ideas on how to implement it |
| 28 | + |
| 29 | +### Pull Requests |
| 30 | + |
| 31 | +We actively welcome pull requests! |
| 32 | + |
| 33 | +#### Before You Start |
| 34 | + |
| 35 | +1. Check existing issues and PRs to avoid duplicates |
| 36 | +2. For major changes, please open an issue first to discuss |
| 37 | +3. Fork the repository and create a branch from `main` |
| 38 | + |
| 39 | +#### Code Guidelines |
| 40 | + |
| 41 | +- **Code Style**: Follow PEP 8 guidelines |
| 42 | +- **Formatting**: Use `black` for code formatting: |
| 43 | + ```bash |
| 44 | + black custom_components/ |
| 45 | + ``` |
| 46 | +- **Import Sorting**: Use `isort` for import organization: |
| 47 | + ```bash |
| 48 | + isort custom_components/ |
| 49 | + ``` |
| 50 | +- **Linting**: Run `flake8` to check for issues: |
| 51 | + ```bash |
| 52 | + flake8 custom_components/ --count --select=E9,F63,F7,F82 --show-source --statistics |
| 53 | + ``` |
| 54 | + |
| 55 | +#### Testing |
| 56 | + |
| 57 | +Before submitting a PR, ensure: |
| 58 | + |
| 59 | +1. **Code Quality Checks Pass**: |
| 60 | + ```bash |
| 61 | + black --check custom_components/ |
| 62 | + isort --check-only custom_components/ |
| 63 | + flake8 custom_components/ --count --select=E9,F63,F7,F82 --show-source --statistics |
| 64 | + ``` |
| 65 | + |
| 66 | +2. **Python Syntax Validation**: |
25 | 67 | ```bash |
26 | | - pip install -r requirements-dev.txt |
| 68 | + python -m py_compile custom_components/http_agent/*.py |
27 | 69 | ``` |
28 | 70 |
|
29 | | -#### Code Standards |
30 | | -- Follow PEP 8 style guidelines |
31 | | -- Use Black for code formatting: `black custom_components/http_agent` |
32 | | -- Sort imports with isort: `isort custom_components/http_agent` |
33 | | -- Run flake8 for linting: `flake8 custom_components/http_agent` |
| 71 | +3. **API Tests Pass**: |
| 72 | + ```bash |
| 73 | + python3 test_api.py |
| 74 | + ``` |
34 | 75 |
|
35 | | -#### Testing |
36 | | -- Ensure all GitHub Actions pass |
37 | | -- Test with different Home Assistant versions if possible |
38 | | -- Add tests for new features when applicable |
| 76 | +4. **Integration Works**: Test in Home Assistant using the Docker environment |
39 | 77 |
|
40 | | -#### Pull Requests |
41 | | -1. Create a feature branch from `main` |
42 | | -2. Make your changes |
43 | | -3. Ensure all tests pass |
44 | | -4. Update documentation if needed |
45 | | -5. Submit a pull request with a clear description |
| 78 | +#### Translation Guidelines |
| 79 | + |
| 80 | +If adding or modifying translations: |
| 81 | + |
| 82 | +1. Always update `custom_components/http_agent/strings.json` first |
| 83 | +2. Update all language files in `custom_components/http_agent/translations/`: |
| 84 | + - `en.json` (English) |
| 85 | + - `sv.json` (Swedish) |
| 86 | + - `da.json` (Danish) |
| 87 | + - `de.json` (German) |
| 88 | + - `fi.json` (Finnish) |
| 89 | + - `no.json` (Norwegian) |
| 90 | +3. Ensure all files maintain the same key structure (203 keys) |
| 91 | +4. Validate JSON syntax: |
| 92 | + ```bash |
| 93 | + python3 -m json.tool custom_components/http_agent/translations/LANGUAGE.json |
| 94 | + ``` |
46 | 95 |
|
47 | 96 | #### Commit Messages |
| 97 | + |
48 | 98 | - Use clear, descriptive commit messages |
49 | | -- Start with a verb (Add, Fix, Update, etc.) |
50 | | -- Keep the first line under 50 characters |
51 | | -- Add details in the body if needed |
| 99 | +- Start with a verb in present tense (e.g., "Add", "Fix", "Update") |
| 100 | +- Reference issue numbers when applicable |
52 | 101 |
|
53 | | -## Development Guidelines |
| 102 | +Example: |
| 103 | +``` |
| 104 | +Add support for custom authentication headers (#123) |
54 | 105 |
|
55 | | -### Code Structure |
56 | | -- Follow Home Assistant integration patterns |
57 | | -- Use async/await for I/O operations |
58 | | -- Handle errors gracefully |
59 | | -- Add proper logging |
| 106 | +- Add new config flow step for auth configuration |
| 107 | +- Update coordinator to handle auth headers |
| 108 | +- Add tests for authentication |
| 109 | +``` |
| 110 | + |
| 111 | +#### Pull Request Process |
| 112 | + |
| 113 | +1. Update documentation if needed |
| 114 | +2. Update CHANGELOG.md with your changes |
| 115 | +3. Ensure all CI checks pass |
| 116 | +4. Request review from maintainers |
| 117 | +5. Address any feedback |
60 | 118 |
|
61 | 119 | ### Documentation |
62 | | -- Update README.md for user-facing changes |
63 | | -- Update docstrings for code changes |
64 | | -- Add examples for new features |
65 | 120 |
|
66 | | -### Internationalization |
67 | | -- Add translation keys to all language files |
68 | | -- Use descriptive translation keys |
69 | | -- Test with different languages |
| 121 | +- Update README.md if you change functionality |
| 122 | +- Add code comments for complex logic |
| 123 | +- Update configuration examples if needed |
| 124 | + |
| 125 | +## Code of Conduct |
| 126 | + |
| 127 | +### Our Pledge |
| 128 | + |
| 129 | +We are committed to providing a welcoming and inclusive environment for everyone. |
70 | 130 |
|
71 | | -## Getting Help |
| 131 | +### Our Standards |
72 | 132 |
|
73 | | -- Check existing issues and pull requests |
74 | | -- Ask questions in GitHub Discussions |
75 | | -- Join the Home Assistant community forums |
| 133 | +Examples of behavior that contributes to a positive environment: |
| 134 | + |
| 135 | +- Using welcoming and inclusive language |
| 136 | +- Being respectful of differing viewpoints |
| 137 | +- Gracefully accepting constructive criticism |
| 138 | +- Focusing on what is best for the community |
| 139 | +- Showing empathy towards others |
| 140 | + |
| 141 | +Examples of unacceptable behavior: |
| 142 | + |
| 143 | +- Harassment or discriminatory language |
| 144 | +- Trolling or insulting comments |
| 145 | +- Personal or political attacks |
| 146 | +- Publishing others' private information |
| 147 | +- Other conduct which could reasonably be considered inappropriate |
| 148 | + |
| 149 | +### Enforcement |
| 150 | + |
| 151 | +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainers. All complaints will be reviewed and investigated promptly and fairly. |
| 152 | + |
| 153 | +## Questions? |
| 154 | + |
| 155 | +If you have questions, feel free to: |
| 156 | + |
| 157 | +- Open an issue for discussion |
| 158 | +- Check existing documentation |
| 159 | +- Review closed issues and PRs |
76 | 160 |
|
77 | 161 | ## License |
78 | 162 |
|
79 | | -By contributing, you agree that your contributions will be licensed under the MIT License. |
| 163 | +By contributing, you agree that your contributions will be licensed under the same license as the project (see LICENSE file). |
| 164 | + |
| 165 | +--- |
| 166 | + |
| 167 | +Thank you for contributing to HTTP Agent! 🎉 |
0 commit comments