ci: use recommended-replacement format in cspell flagWords - #5
Conversation
Match the flagWords format already used in linuxfoundation/lfx-v1-sync-helper's .cspell.json, where each entry includes a suggested replacement (e.g. "master: controller, primary, main, leader, parent") instead of just the flagged word alone. This gives contributors an actionable suggestion instead of just a bare rejection. Also picks up the grandfathered entry that was missing here. Assisted-by: github-copilot:claude-sonnet-5 Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
Standardizes cspell flagged-word entries with recommended replacements and adds the missing grandfathered term.
Changes:
- Adds replacement guidance to all flagged words.
- Adds
grandfatheredwith alternatives.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace the inline flagWords list with an empty placeholder pulled in at MegaLinter run time from linuxfoundation/lfx-public-workflows' cspell/flagwords.snippet.json (see that repo's cspell/README.md), instead of duplicating and drifting the list locally. Assisted-by: github-copilot:claude-sonnet-5 Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
|
Updated to also adopt the new shared cspell flagWords mechanism (linuxfoundation/lfx-public-workflows#15) instead of keeping the list inline here — see that PR's |
| "blacklist", | ||
| "black-list" | ||
| ], | ||
| "flagWords": [], |
| SPELL_CSPELL_PRE_COMMANDS: | ||
| - command: >- | ||
| curl -sf | ||
| https://raw.githubusercontent.com/linuxfoundation/lfx-public-workflows/main/cspell/flagwords.snippet.json |
…FXV2-3338) Address review feedback on the shared cspell flagWords mechanism: the sed substitution mutated the tracked .cspell.json in place. In CI this is harmless (ephemeral checkout), but a developer running MegaLinter locally via 'make megalinter' bind-mounts the real working directory, so the substitution would persist to disk and could get accidentally committed, and a second local run would silently no-op (placeholder already consumed) instead of re-fetching the latest shared list. Back up .cspell.json before the substitution and restore it via a global POST_COMMANDS entry once the run finishes, matching the fix landed in linuxfoundation/lfx-public-workflows#15. Assisted-by: github-copilot:claude-sonnet-5 Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.cspell.json:8
- This reformatting is rejected by the repository's configured JSON Prettier check; the current MegaLinter run reports
.cspell.jsonas having code-style issues. Keep this short array on one line so the changed configuration passes the formatter.
"dictionaries": [
"companies",
"filetypes",
"fullstack",
"softwareTerms"
],
| SPELL_CSPELL_PRE_COMMANDS: | ||
| - command: >- | ||
| cp .cspell.json /tmp/cspell.json.orig && | ||
| curl -sf | ||
| https://raw.githubusercontent.com/linuxfoundation/lfx-public-workflows/main/cspell/flagwords.snippet.json | ||
| -o /tmp/flagwords.snippet.json && | ||
| sed -i -e '/"flagWords": \[\]/{r /tmp/flagwords.snippet.json' -e 'd}' .cspell.json | ||
| cwd: "workspace" |
…rors (LFXV2-3338) Address review feedback on the shared cspell flagWords mechanism: - MegaLinter v9.6.0 supports per-linter <LINTER>_POST_COMMANDS. Use SPELL_CSPELL_POST_COMMANDS instead of the global POST_COMMANDS, so the restore runs immediately after cspell finishes rather than waiting for every other linter to complete, and can't fire in a run where cspell itself didn't execute. - MegaLinter's PRE_COMMANDS default to continue_if_failed: true, so a failed curl fetch or sed substitution would silently leave the placeholder-only flagWords: [] in place and let the run continue. Set continue_if_failed: false explicitly, and use curl -sSf (instead of -sf) so a fetch failure's error detail is preserved in logs. Matches the fix landed in linuxfoundation/lfx-public-workflows#15. Assisted-by: github-copilot:claude-sonnet-5 Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
.mega-linter.yml:25
- This URL currently returns 404 because
linuxfoundation/lfx-public-workflowsdoes not containcspell/flagwords.snippet.jsononmain; the file only exists in the still-open upstream PR #15. Sincecurl -fandcontinue_if_failed: falseare used, every MegaLinter run will fail this pre-command before cspell runs. Merge the upstream dependency before this PR (or reference an already-published, preferably pinned, artifact).
https://raw.githubusercontent.com/linuxfoundation/lfx-public-workflows/main/cspell/flagwords.snippet.json
Summary
Per LFXV2-3338, standardize this repo's
.cspell.jsonflagWordsformat to include recommended replacements (as used inlinuxfoundation/lfx-v1-sync-helper), rather than just the bare flagged word, e.g.:master→master: controller, primary, main, leader, parentwhitelist→whitelist: allowlistAlso adds the
grandfatheredentry that was missing here.Jira
LFXV2-3338
🤖 Generated with GitHub Copilot (via OpenCode)