Skip to content

Add modernize to golangci-lint, apply autofixes#631

Merged
sairon merged 1 commit intohome-assistant:masterfrom
scop:refactor/modernize
Mar 31, 2026
Merged

Add modernize to golangci-lint, apply autofixes#631
sairon merged 1 commit intohome-assistant:masterfrom
scop:refactor/modernize

Conversation

@scop
Copy link
Copy Markdown
Member

@scop scop commented Feb 2, 2026

Summary by CodeRabbit

  • Refactor

    • Updated internal code syntax to use modern Go conventions.
  • Chores

    • Enhanced code quality standards with improved linting configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

This pull request modernizes the Go codebase by enabling the modernize linter, replacing deprecated interface{} type declarations with the any alias, and updating loop syntax to use Go's range-over-int form for readability and maintainability.

Changes

Cohort / File(s) Summary
Linter Configuration
.golangci.yaml
Enabled the modernize linter in golangci-lint configuration to enforce modern Go conventions.
Type Modernization
cmd/apps_rebuild.go, cmd/auth_reset.go
Replaced deprecated map[string]interface{} and []interface{} type declarations with map[string]any and []any respectively, aligning with Go 1.18+ conventions.
Loop Syntax Modernization
spinner/character_sets.go
Updated loop from traditional counted form (for i := rune(0); i < 12; i++) to range-over-int form (for i := range rune(12)) for cleaner iteration syntax.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: enabling the modernize linter and applying its suggested autofixes across multiple files (Go type modernization from interface{} to any).

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sairon sairon merged commit 0fd9590 into home-assistant:master Mar 31, 2026
9 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants