Skip to content

ci: repo hygiene — ruff-format, delete dead automation, defang renovate#21

Merged
florianhorner merged 3 commits into
mainfrom
florianhorner/ci-hygiene
Jun 2, 2026
Merged

ci: repo hygiene — ruff-format, delete dead automation, defang renovate#21
florianhorner merged 3 commits into
mainfrom
florianhorner/ci-hygiene

Conversation

@florianhorner
Copy link
Copy Markdown
Owner

Summary

Repo hygiene: remove dead inherited automation, align the formatter with local
tooling, and defang unsafe defaults. No product code behavior changes. [proof: config]

Changes

Formatter (stops the recurring churn)

  • Replace black with ruff-format in pre-commit. Editors run ruff format but CI
    used black; they disagreed on a few constructs, producing phantom diffs on every
    Python edit. One formatter end-to-end fixes it. Ignored COM812/ISC001 (they conflict
    with the formatter). Only 4 files needed reformatting. [proof: config]

Delete dead community automation / stale workflows

  • .github/ISSUE_TEMPLATE/ (Issues are disabled; links/labels point upstream),
    config.yml + auto-comment.yml (welcome bots not installed), toc.yaml
    (3-yr-stale third-party action), release-drafter workflow + config (release.yml
    never consumes the draft; it left an orphan draft, now deleted).

Trim noisy / unsafe CI behavior

  • docs.yml: upload the Pages artifact on push only (PRs can't deploy).
  • markdown-code-runner.yml: keep the PR drift-gate, drop the push-to-main
    auto-commit (it raced with toc.yaml and re-triggered every push workflow).
  • renovate.json: disable automerge (no branch protection yet) and the dead
    dependencyDashboard (Issues disabled).

Notes / deferred

  • toc.yaml deletion: the README TOC no longer auto-regenerates; it rarely changes and
    can be run manually (folding doctoc into scripts/update-generated-content was left
    as a small follow-up).
  • Still pending from the plan: version reconcile (manifest/pyproject 1.30.1 vs
    release tags) + a CONTRIBUTING.md, and enabling required-status-checks (branch
    protection) now that the trimmed check names are final.

Proof

  • config: .pre-commit-config.yaml — black hook replaced with ruff-format [proof: config]
  • lint: .ruff.toml — COM812/ISC001 ignored to avoid formatter conflicts; ruff check + ruff format both pass locally [proof: lint]
  • tests: n/a — no test logic changed; 4 files were reformatted only [proof: tests]
  • build: n/a — no build step in this change [proof: build]
  • runtime: n/a — tooling/CI hygiene change; this PR's own checks are the runtime verification [proof: runtime]

florianhorner and others added 3 commits June 2, 2026 23:36
Replace the black pre-commit hook with ruff-format. Editors run `ruff
format`, but CI used black, and the two disagree on a few constructs (e.g.
wrapping `assert X, msg`), which produced phantom diffs on every Python
edit. Using one formatter (ruff) end to end removes that churn.

- .pre-commit-config.yaml: drop psf/black, add the ruff-format hook.
- .ruff.toml: ignore COM812 and ISC001 (they conflict with the formatter).
- Reformat the 4 files where black and ruff-format differed (const.py,
  test_init.py, test_switch.py, webapp/app.py); the other 28 already match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These are unmodified upstream community-management artifacts that are dead
on a solo fork (Issues and Discussions are disabled, no Probot apps are
installed, labels referenced don't exist):

- .github/ISSUE_TEMPLATE/ (issues are disabled; links/labels point upstream)
- .github/config.yml, .github/auto-comment.yml (welcome/auto-comment bots
  that aren't installed)
- toc.yaml (a 3-year-stale third-party action holding a write token; the
  README TOC rarely changes and can be regenerated manually)
- release-drafter.yml + config (release.yml never consumes the draft; it
  uses generate_release_notes instead, and the drafter left an orphan draft)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- docs.yml: only upload the Pages artifact on push (PRs can't deploy --
  the deploy job is gated to push on main -- so the upload was wasted; the
  build still runs on PRs as a sanity check).
- markdown-code-runner.yml: keep the PR drift-gate but drop the
  push-to-main auto-commit, which raced with toc.yaml and re-triggered
  every push:[main] workflow. With the PR gate, main can't drift.
- renovate.json: disable automerge (no branch protection yet, so auto-
  landing dep bumps is unsafe) and dependencyDashboard (Issues are
  disabled, so the dashboard can't render).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Release Notes

Formatter migration: Black → Ruff

  • Code formatting now uses ruff-format instead of black in pre-commit configuration. Config rules COM812 (trailing comma) and ISC001 (implicit string concatenation) are ignored to avoid formatter conflicts. Four files were reformatted to match ruff standards.

Removed community automation

  • Deleted GitHub issue templates (bug report, documentation, enhancement, feature)
  • Deleted .github/config.yml (welcome bot comments)
  • Deleted .github/auto-comment.yml
  • Deleted release-drafter workflow and config (no longer generating draft releases on main pushes)
  • Deleted automatic TOC generation workflow (README.md TOC must be updated manually)

CI/deployment changes

  • Docs artifact upload now occurs on push to main only; PRs still build as a sanity check
  • Markdown code runner workflow changed to drift-gate only (fails if generated files are stale); removed auto-commit/push behavior
  • Renovate: disabled automerge and dependency dashboard

Note: No breaking changes to product behavior. Pending: reconcile manifest/pyproject version numbers and enable branch protection rules once status checks are finalized.

Walkthrough

This PR performs repository maintenance by removing unused GitHub issue templates and automation configurations, disables Renovate dashboard and automerge features, modifies workflow behavior (documentation artifact gating and generated-content drift detection), updates development tooling (black→ruff-format, additional Ruff lint rules), and refactors test assertions for clearer failure messages.

Changes

Repository Maintenance and Quality Improvements

Layer / File(s) Summary
Renovate Configuration Updates
.github/renovate.json
Disables dependency dashboard and automerge features in Renovate configuration.
GitHub Actions Workflow Modifications
.github/workflows/docs.yml, .github/workflows/markdown-code-runner.yml
Documentation workflow uploads Pages artifacts only on non-PR pushes; generated-content workflow switches from auto-commit to drift-detection mode that fails on stale files.
Development Tooling Configuration
.pre-commit-config.yaml, .ruff.toml
Pre-commit formatter migrated from black to ruff-format; COM812 and ISC001 Ruff rules added to global ignore list.
Test Assertion Improvements
tests/test_init.py, tests/test_switch.py
Test assertions refactored with multi-line failure messages; non-HA change detection test expanded to explicitly validate brightness and color attributes; manual-control, warning-count, and light-group-expansion tests use clearer assertion context.
Documentation and Code Formatting
custom_components/adaptive_lighting/const.py, webapp/app.py
Configuration documentation strings tightened for formatting consistency; y-axis tick label expression updated for readability.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • florianhorner/adaptive-lighting#13: Adds comprehensive coverage for expand_light_groups behavior and warning paths; complements this PR's assertion improvements to the same test areas.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title follows conventional commits format with 'ci:' prefix, is exactly 71 characters (under 72 limit), uses specific and descriptive terms, and accurately summarizes the main changes.
Description check ✅ Passed Description is directly related to the changeset, providing detailed explanations of formatter changes, deleted automation, CI behavior modifications, and the rationale behind each change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch florianhorner/ci-hygiene

Comment @coderabbitai help to get the list of available commands and usage tips.

@florianhorner florianhorner merged commit 6a6f3ac into main Jun 2, 2026
10 of 11 checks passed
@florianhorner florianhorner deleted the florianhorner/ci-hygiene branch June 2, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant