Skip to content

ci: use recommended-replacement format in cspell flagWords - #5

Draft
emsearcy wants to merge 4 commits into
mainfrom
lfxv2-3338-cspell-flagwords
Draft

ci: use recommended-replacement format in cspell flagWords#5
emsearcy wants to merge 4 commits into
mainfrom
lfxv2-3338-cspell-flagwords

Conversation

@emsearcy

Copy link
Copy Markdown
Contributor

Summary

Per LFXV2-3338, standardize this repo's .cspell.json flagWords format to include recommended replacements (as used in linuxfoundation/lfx-v1-sync-helper), rather than just the bare flagged word, e.g.:

  • mastermaster: controller, primary, main, leader, parent
  • whitelistwhitelist: allowlist

Also adds the grandfathered entry that was missing here.

Jira

LFXV2-3338

🤖 Generated with GitHub Copilot (via OpenCode)

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>
Copilot AI balanced review requested due to automatic review settings August 21, 2026 18:49
@emsearcy
emsearcy requested a review from a team as a code owner August 21, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 grandfathered with 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>
Copilot AI review requested due to automatic review settings August 21, 2026 18:58
@emsearcy

Copy link
Copy Markdown
Contributor Author

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 cspell/README.md for details.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread .cspell.json
"blacklist",
"black-list"
],
"flagWords": [],
Comment thread .mega-linter.yml
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>
Copilot AI review requested due to automatic review settings August 21, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.json as having code-style issues. Keep this short array on one line so the changed configuration passes the formatter.
  "dictionaries": [
    "companies",
    "filetypes",
    "fullstack",
    "softwareTerms"
  ],

Comment thread .mega-linter.yml
Comment on lines +21 to +28
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>
Copilot AI review requested due to automatic review settings August 21, 2026 21:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-workflows does not contain cspell/flagwords.snippet.json on main; the file only exists in the still-open upstream PR #15. Since curl -f and continue_if_failed: false are 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

@emsearcy
emsearcy marked this pull request as draft August 21, 2026 21:31
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.

2 participants