Skip to content

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

Merged
emsearcy merged 10 commits into
mainfrom
lfxv2-3338-cspell-flagwords
Sep 14, 2026
Merged

emsearcy merged 10 commits into
mainfrom
lfxv2-3338-cspell-flagwords

Conversation

@emsearcy

@emsearcy emsearcy commented Aug 21, 2026 •

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.:

  • master → master: controller, primary, main, leader, parent
  • whitelist → whitelist: allowlist

Also adds the grandfathered entry that was missing here.

Also fixes a pre-existing typo in the README's lfx api example (object_type=projects → object_type=project, matching the actual my-grants API), with the corresponding api_test.go example updated to match.

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 Outdated
Comment thread .mega-linter.yml Outdated
…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 Outdated
…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
The runtime injection via SPELL_CSPELL_PRE_COMMANDS fetched a
flagwords snippet from a URL that does not exist on
lfx-public-workflows's main branch, causing the MegaLinter cspell
pre-command to fail on every run. Commit the recommended-replacement
flagWords entries directly in .cspell.json instead, matching the
lfx-v1-sync-helper reference configuration.

Also add the MegaLinter env: hygiene comment, and megalinter-reports/
gitignore entry per the LFXV2-3338 standardization.

LFXV2-3338

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 25, 2026 21:12

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 3 changed files in this pull request and generated no new comments.

@emsearcy
emsearcy marked this pull request as ready for review August 25, 2026 21:16
@emsearcy
emsearcy marked this pull request as draft August 25, 2026 21:32
Copilot AI review requested due to automatic review settings August 26, 2026 19:35

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 3 changed files in this pull request and generated no new comments.

@emsearcy
emsearcy marked this pull request as ready for review August 26, 2026 21:17
@emsearcy
emsearcy marked this pull request as draft August 27, 2026 05:57
Signed-off-by: Eric Searcy <eric@linuxfoundation.org>
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 28, 2026 21:00
@emsearcy
emsearcy marked this pull request as ready for review August 28, 2026 21:01

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 3 out of 4 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 31, 2026 15:51

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 3 out of 4 changed files in this pull request and generated 1 comment.

Comment thread README.md
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 31, 2026 18:41

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 4 out of 5 changed files in this pull request and generated no new comments.

@dealako

dealako commented Sep 11, 2026

Copy link
Copy Markdown

@emsearcy Nice work iterating on this — the final shape is much cleaner than the runtime-injection approach.

This PR standardizes .cspell.json flagWords to the recommended-replacement format (matching lfx-v1-sync-helper), adds the missing grandfathered entry, documents MegaLinter env-vs-config hygiene in the workflow, tightens the megalinter-reports/ gitignore entry, and fixes the my-grants README example to use singular object_type=project with the matching api_test.go case aligned.

All CI checks pass, including MegaLinter. Prior Copilot feedback on the empty placeholder, the 404 snippet URL, and the README object_type scope has been addressed in subsequent commits.

Issue count

  • 🔴 Blocking: 0 issues
  • 🟡 Minor: 0 issues
  • ⚪ Nit: 1 issue: incidental multi-line reformat of short JSON arrays in .cspell.json (Prettier/CI is clean; optional consistency with lfx-v1-sync-helper single-line style)
  • ❔ Question: 0 items

Revision tracking (prior rounds)

  • ✅ Resolved: empty flagWords: [] placeholder — flagWords committed directly (eb3f753)
  • ✅ Resolved: 404 flagwords.snippet.json fetch — runtime pre/post commands removed (eb3f753)
  • ✅ Resolved: README object_type vs test mismatch — api_test.go updated to project (67666ac)
  • ✅ Resolved: flagwords filename cspell noise — moot after injection removal

Bot reconciliation

  • Agree with Copilot on the runtime-injection and 404 concerns; author fixes look correct.
  • Prior Copilot Prettier-on-.cspell.json note appears stale — current MegaLinter run passes.

✅ Approved with minor comments

@dealako dealako 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.

Review

Focused, low-risk CI/docs hygiene PR. Security and privacy dimensions are clean for the changed surface (config, workflow comment, gitignore, README, test string).

Findings

⚪ Nit — .cspell.json short-array formatting

Incidental multi-line reformat of dictionaries and ignoreRegExpList diverges from the pre-change repo style and lfx-v1-sync-helper's single-line short arrays. MegaLinter/Prettier passes on the current branch, so this is optional consistency only.

Prior feedback status

All earlier Copilot blocking concerns (empty flagWords placeholder, 404 snippet URL, README/test object_type drift) are resolved in later commits.

✅ Approved with minor comments

Comment thread .cspell.json
{
"language": "en",
"dictionaries": ["companies", "filetypes", "fullstack", "softwareTerms"],
"dictionaries": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[nit] Short JSON arrays expanded to multi-line

Issue: dictionaries and ignoreRegExpList were reformatted from single-line arrays to multi-line without functional need.
Proof: .cspell.json:3-8 and .cspell.json:77-79 vs main's single-line equivalents.
Why it matters: Incidental churn; optional consistency with lfx-v1-sync-helper single-line short arrays.
Fix: Restore single-line formatting for those short arrays if you want to minimize diff noise; not required — MegaLinter passes as-is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that's prettier linting

@emsearcy
emsearcy merged commit 65ab3de into main Sep 14, 2026
9 checks passed
@emsearcy
emsearcy deleted the lfxv2-3338-cspell-flagwords branch September 14, 2026 18:59
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.

3 participants