Skip to content

Commit 4bfd642

Browse files
Merge pull request #6 from L3DigitalNet/maintenance/community-health-2026-02-18
[Maintenance] Community health — SECURITY.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, PR template fix
2 parents 171a35e + 6b7b594 commit 4bfd642

4 files changed

Lines changed: 199 additions & 1 deletion

File tree

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please delete options that are not relevant.
1616

1717
## Integration Quality Scale
1818

19-
Which quality tier does this PR target or improve? See [docs/QUALITY_CHECKLIST.md](../docs/QUALITY_CHECKLIST.md) for detailed requirements.
19+
Which quality tier does this PR target or improve? See the [HA Integration Quality Scale](https://developers.home-assistant.io/docs/integration_quality_scale_index) for detailed requirements.
2020

2121
- [ ] Bronze (Config flow, basic tests, manifest)
2222
- [ ] Silver (Error handling, availability, documentation)

CODE_OF_CONDUCT.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to a positive environment:
15+
16+
- Using welcoming and inclusive language
17+
- Being respectful of differing viewpoints and experiences
18+
- Gracefully accepting constructive criticism
19+
- Focusing on what is best for the community
20+
- Showing empathy towards other community members
21+
22+
Examples of unacceptable behavior:
23+
24+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
25+
- Trolling, insulting or derogatory comments, and personal or political attacks
26+
- Public or private harassment
27+
- Publishing others' private information without explicit permission
28+
- Other conduct which could reasonably be considered inappropriate in a professional setting
29+
30+
## Enforcement Responsibilities
31+
32+
Community leaders are responsible for clarifying and enforcing our standards of
33+
acceptable behavior and will take appropriate and fair corrective action in
34+
response to any behavior that they deem inappropriate, threatening, offensive,
35+
or harmful.
36+
37+
## Scope
38+
39+
This Code of Conduct applies within all community spaces, and also applies when
40+
an individual is officially representing the community in public spaces.
41+
42+
## Enforcement
43+
44+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
45+
reported to the community leaders responsible for enforcement at
46+
**security@l3digital.net**.
47+
48+
All complaints will be reviewed and investigated promptly and fairly.
49+
50+
## Attribution
51+
52+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
53+
version 2.1, available at
54+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

CONTRIBUTING.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Contributing to ha-light-controller
2+
3+
Thank you for your interest in contributing! This document provides guidelines
4+
and information for contributors.
5+
6+
## Getting Started
7+
8+
1. Fork the repository
9+
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/ha-light-controller.git`
10+
3. Create a feature branch: `git checkout -b feature/your-feature-name`
11+
4. Make your changes
12+
5. Push to your fork: `git push origin feature/your-feature-name`
13+
6. Open a Pull Request against the `main` branch
14+
15+
## Development Setup
16+
17+
### Prerequisites
18+
19+
- Python 3.13+
20+
- [UV](https://docs.astral.sh/uv/) package manager
21+
22+
### Install UV
23+
24+
```bash
25+
curl -LsSf https://astral.sh/uv/install.sh | sh
26+
```
27+
28+
### Set up the project
29+
30+
```bash
31+
git clone https://github.com/L3DigitalNet/ha-light-controller.git
32+
cd ha-light-controller
33+
make setup # Creates venv and installs dependencies
34+
source .venv/bin/activate
35+
```
36+
37+
### Run tests
38+
39+
```bash
40+
make test # Run all tests
41+
make test-cov # Run tests with coverage report
42+
pytest tests/test_controller.py # Run a specific test file
43+
```
44+
45+
Tests mock the `homeassistant` module — no running Home Assistant instance is needed.
46+
47+
### Quality checks
48+
49+
```bash
50+
make lint # Ruff linter
51+
make lint-fix # Lint with auto-fix
52+
make format # Ruff formatter
53+
make type-check # mypy type checker
54+
make quality # All checks at once
55+
make ci # Full CI simulation
56+
```
57+
58+
## Pull Request Guidelines
59+
60+
- **One concern per PR.** Keep changes focused and reviewable.
61+
- **Write descriptive commit messages.** Explain *what* changed and *why*.
62+
- **Update CHANGELOG.md** for all non-trivial changes.
63+
- **Add tests** for new functionality.
64+
- **Ensure all checks pass** before requesting review: `make ci`
65+
66+
## Home Assistant Constraints
67+
68+
This is a Home Assistant integration. All contributions must follow HA's async requirements:
69+
70+
- **Never use blocking I/O** — no `time.sleep()`, sync `requests`, or blocking file operations
71+
- **All I/O must be async** — use `await`, or `hass.async_add_executor_job()` for unavoidable sync calls
72+
- **Use HA APIs**`hass.services.async_call`, `hass.states.get`, etc. Never bypass the state machine
73+
74+
## Code Style
75+
76+
This project uses [Ruff](https://docs.astral.sh/ruff/) for linting and formatting, and [mypy](https://mypy.readthedocs.io/) for type checking.
77+
78+
- Run `make format` to auto-format code
79+
- Run `make lint` to check for issues (or `make lint-fix` to auto-fix)
80+
- Run `make type-check` to verify types — all new code must pass with 0 errors
81+
- Use modern Python type hints (`list[str]`, `X | None` — not `List`, `Optional`)
82+
- Prefer flat over nested — if nesting exceeds 3 levels, extract a helper
83+
84+
## Reporting Issues
85+
86+
- Use the [issue tracker](https://github.com/L3DigitalNet/ha-light-controller/issues) to report bugs
87+
- Check existing issues before creating a new one
88+
- Use the issue templates when available
89+
- Include steps to reproduce for bug reports
90+
91+
## Security Issues
92+
93+
Please do **not** open public issues for security vulnerabilities. See [SECURITY.md](SECURITY.md) for responsible disclosure instructions.
94+
95+
## License
96+
97+
By contributing, you agree that your contributions will be licensed under the same [MIT License](LICENSE) as the project.
98+
99+
## Questions?
100+
101+
Feel free to open a [GitHub Discussion](https://github.com/L3DigitalNet/ha-light-controller/discussions) or an issue if you have questions about contributing.

SECURITY.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you discover a security vulnerability in this project, please report it responsibly.
6+
7+
**Do NOT open a public GitHub issue for security vulnerabilities.**
8+
9+
### Contact
10+
11+
- **Email:** security@l3digital.net
12+
- **Subject line:** [SECURITY] ha-light-controller — Brief description
13+
14+
### What to include
15+
16+
- Description of the vulnerability
17+
- Steps to reproduce
18+
- Potential impact
19+
- Suggested fix (if any)
20+
21+
### Response timeline
22+
23+
- **Acknowledgment:** Within 3 business days
24+
- **Assessment:** Within 1 week of acknowledgment
25+
- **Fix timeline:** Depends on severity, but we aim to address critical issues within 30 days
26+
27+
## Supported Versions
28+
29+
| Version | Supported |
30+
|---------|-----------|
31+
| Latest release ||
32+
| Previous minor ||
33+
| Older versions ||
34+
35+
## Disclosure Policy
36+
37+
We follow coordinated disclosure. We ask that you:
38+
39+
1. Give us reasonable time to address the issue before public disclosure
40+
2. Make a good faith effort to avoid privacy violations, data destruction, or service disruption
41+
3. Do not access or modify other users' data
42+
43+
We will credit reporters who follow responsible disclosure practices.

0 commit comments

Comments
 (0)