Clean Code: improvements, review report, and project skill#37
Merged
Conversation
- Rewrite users-guide.md (EN/DE) with correct title, display layout, OTA updates, time sync, and troubleshooting — previously used wrong title 'Pool Controller' and was outdated since 2022 - Fix _index.de.md missing space in summary field - Fix project structure in software-guide.md (EN/DE) to match current src/PoolMonitor/ namespace layout - Update library list to match platformio.ini (add ArduinoJson, fix PubSubClient) - Remove duplicate power budget table in hardware-guide solar section (EN/DE) - Remove out-of-place changelog from software-guide — belongs in CHANGELOG.md - Fix heading hierarchy in home-assistant-migration.md - Update Readme.md solar feature status as implemented, fix planned features - Rewrite CONTRIBUTING.md with valid code-block languages (text), updated project structure, Docker note for make lint - Fix _config.yml YAML indentation - Update lastmod dates across all docs
…dead code removal - Extract drawDegreeSymbol() and drawPumpIcon() helpers in DisplayManager to eliminate duplicated circle-drawing (6x → 2 calls) and pump icon logic - Rename HA_TOPIC_* constants to C++ k-prefix convention with static constexpr - Remove unused Self static pointer (dead code) - Remove noise comments (obvious '// no copy', '// State variables', etc.) - Normalize trailing return types in PoolMonitorContext.hpp for consistency - Preserve all behavior: zero functional changes, verified by build
NetworkManager::begin() was never called anywhere in the codebase, making it dead code along with its associated state members (apModeActive_, mdnsRunning_, hostname_). The WiFi + mDNS initialization is handled by WiFiSettings callbacks in PoolMonitorContext::initializeNetwork(). Removed: - NetworkManager::begin() declaration and implementation - Dead static members: apModeActive_, mdnsRunning_, hostname_ - Unused includes: <IPAddress.h>, <ESPmDNS.h>
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clean Code Review & Project Skill
Dieser PR kombiniert zwei Dinge: (1) konkrete Clean-Code-Verbesserungen aus dem Code-Review, und (2) einen projekt-spezifischen Clean-Code-Skill für zukünftige Reviews.
Teil 1: Implementierte Clean-Code-Verbesserungen
DRY — Display Drawing extrahiert
Grad-Symbol (3× drawCircle) 6× →
drawDegreeSymbol()Pumpen-Icon 2× →
drawPumpIcon()Toter Code entfernt
NetworkManager::begin()— nie aufgerufenapModeActive_,mdnsRunning_,hostname_IPAddress.h,ESPmDNS.hstatic PoolMonitorContext* Self— nie gelesenWeitere
constexpr+ k-Prefix= defaultTeil 2: Clean Code Project Skill
Neue Datei
.opencode/skills/clean-code/SKILL.md— ein projekt-spezifischer Skill mit:AGENTS.mdunter "Projekt-Skill: Clean Code"Zukünftig vor jedem Commit/PR via
skill("clean-code")laden.Build