Repository navigation
Shared code blocks of the sprayer and seed drill programs marked, with a CI check - #113
Merged
Merged
Conversation
…h a CI check - 14 blocks (422 lines) that are the same code in Sprayer_ESP32 and Seeder_ESP32 are marked `// ==== shared "name"` ... `// ==== end shared "name"`: web helpers, request helpers, the status log, the network settings POST and the Wi-Fi scan, restart and update, the common PGN cases, the subnet case and the UDP receive, the relay level and the output driving, the Wi-Fi settings load/save/reset, the checksum and the event log. - .github/scripts/check_shared_blocks.py pairs the blocks by name and fails on a difference, a block missing from one program, an unclosed or nested block, with a diff that names the file and line. The "Shared code" GitHub Action runs it on every pull request that touches either program. - To make two more blocks identical: the sprayer's log line on saving the network settings says "network settings" (as the seed drill's and the page's card); the seed drill gets a masterOn that is always true, so applyOutputs() is the same in both. - Rule in CLAUDE.md; a note in both READMEs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VKEBDHXJYvAsZZ4zDMuykv
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.
Sixth and last PR of the firmware review (after #108 to #112; stacked on
page-cards, so GitHub retargets it once that one is merged).What changes for Renato
// ==== shared "name"and ends with// ==== end shared "name", the same name in both programs..github/scripts/check_shared_blocks.pypairs the blocks by name and fails with a diff (file and line) when one program's block differs from the other's, or a block is missing, unclosed or nested. So a fix made to one module can no longer be forgotten in the other.masterOnthat is always true, soapplyOutputs()is the same code in both (no change in what the relays do).CLAUDE.mdand a note in both READMEs (Notes section). The sprayer's sources now name the seed drill module in these markers: that is the point of the check, but say so if you would rather keep the Sprayer folder free of it.How to test
python3 .github/scripts/check_shared_blocks.py→ "OK: 14 shared blocks, 422 lines the same in Sprayer_ESP32 and Seeder_ESP32".Checks
check_changelog.pyOK.Generated by Claude Code