Skip to content

vale: batch file args to avoid ARG_MAX on large generated-docs PRs - #195

Merged
theletterf merged 1 commit into
mainfrom
fix/vale-arg-list-too-long
Jun 22, 2026
Merged

theletterf merged 1 commit into
mainfrom
fix/vale-arg-list-too-long

Conversation

@theletterf

Copy link
Copy Markdown
Member

Summary

  • When a PR touches thousands of generated files (e.g. an API reference reorganisation in elasticsearch-net), passing the full files_to_lint.txt list as exec args to vale exceeds the Linux ARG_MAX limit, causing E2BIG ("Argument list too long") before vale runs a single check.
  • Fix: run vale in batches of 200 files when the file count exceeds that threshold, then merge the per-batch JSON outputs with jq -s 'add // {}'. Vale's --output=JSON format is a plain object keyed by file path, so merging is a simple deep-merge.
  • The fast path (≤200 files) is unchanged — single invocation, no overhead.

Fixes #170

Test plan

  • Open a docs PR with ≤200 changed .md/.mdx/.yaml files — fast path runs, no change in behaviour.
  • Open or simulate a PR with >200 generated docs files — batch path triggers, vale_output.json is produced correctly, reporter runs without error.
  • Confirm vale_reporter.py downstream is unaffected (it reads vale_output.json as a plain JSON object — format is identical).

🤖 Generated with Claude Code

When a PR touches thousands of generated files (e.g. an API reference
reorganisation), passing the full file list as exec args to vale
exceeds the Linux ARG_MAX limit (E2BIG). Run vale in batches of 200
files and merge the per-batch JSON objects with jq.

Fixes #170

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@theletterf
theletterf requested a review from a team as a code owner June 19, 2026 17:09
@theletterf
theletterf requested a review from technige June 19, 2026 17:09
@github-actions

Copy link
Copy Markdown

Elastic Docs Style Checker (Vale)

Summary: 21 warnings, 19 suggestions found

⚠️ Warnings (21): Fix when the suggestion improves clarity or correctness.
File Line Rule Message
vale/test-fixtures/sample-violations.md 2 Elastic.MappedPages mapped_pages should only be added or updated in rare scenarios. Talk with your local technical writer before pushing changes to this key.
vale/test-fixtures/sample-violations.md 6 Elastic.Articles Use 'an FAQ' instead of 'a FAQ'. The article depends on pronunciation, not spelling.
vale/test-fixtures/sample-violations.md 6 Elastic.Articles Use 'an HTML' instead of 'a HTML'. The article depends on pronunciation, not spelling.
vale/test-fixtures/sample-violations.md 6 Elastic.Articles Use 'an SQL' instead of 'a SQL'. The article depends on pronunciation, not spelling.
vale/test-fixtures/sample-violations.md 6 Elastic.Articles Use 'an HTML' instead of 'a HTML'. The article depends on pronunciation, not spelling.
vale/test-fixtures/sample-violations.md 7 Elastic.BritishSpellings Use American English spelling 'optimize' instead of British English 'optimise'.
vale/test-fixtures/sample-violations.md 7 Elastic.BritishSpellings Use American English spelling 'customize' instead of British English 'customise'.
vale/test-fixtures/sample-violations.md 7 Elastic.BritishSpellings Use American English spelling 'behavior' instead of British English 'behaviour'.
vale/test-fixtures/sample-violations.md 11 Elastic.DontUse Don't use 'just'.
vale/test-fixtures/sample-violations.md 11 Elastic.DontUse Don't use 'please'.
vale/test-fixtures/sample-violations.md 11 Elastic.DontUse Don't use 'aka'.
vale/test-fixtures/sample-violations.md 20 Elastic.Articles Use 'an FAQ' instead of 'a FAQ'. The article depends on pronunciation, not spelling.
vale/test-fixtures/sample-violations.md 20 Elastic.Articles Use 'an HTML' instead of 'a HTML'. The article depends on pronunciation, not spelling.
vale/test-fixtures/sample-violations.md 20 Elastic.Articles Use 'an SQL' instead of 'a SQL'. The article depends on pronunciation, not spelling.
vale/test-fixtures/sample-violations.md 24 Elastic.BritishSpellings Use American English spelling 'optimize' instead of British English 'optimise'.
vale/test-fixtures/sample-violations.md 24 Elastic.BritishSpellings Use American English spelling 'customize' instead of British English 'customise'.
vale/test-fixtures/sample-violations.md 24 Elastic.BritishSpellings Use American English spelling 'behavior' instead of British English 'behaviour'.
vale/test-fixtures/sample-violations.md 40 Elastic.DontUse Don't use 'just'.
vale/test-fixtures/sample-violations.md 40 Elastic.DontUse Don't use 'please'.
vale/test-fixtures/sample-violations.md 40 Elastic.DontUse Don't use 'aka'.
vale/test-fixtures/sample-violations.md 48 Elastic.Articles Use 'an HTML' instead of 'a HTML'. The article depends on pronunciation, not spelling.
💡 Suggestions (19): Optional style improvements. Apply when helpful.
File Line Rule Message
vale/test-fixtures/sample-violations.md 8 Elastic.WordChoice Consider using 'efficiently' instead of 'Simply', unless the term is in the UI.
vale/test-fixtures/sample-violations.md 8 Elastic.WordChoice Consider using 'allowlist' instead of 'whitelist', unless the term is in the UI.
vale/test-fixtures/sample-violations.md 8 Elastic.WordChoice Consider using 'blocklist' instead of 'blacklist', unless the term is in the UI.
vale/test-fixtures/sample-violations.md 9 Elastic.OxfordComma Use the Oxford comma in 'reading, writing and executing.'.
vale/test-fixtures/sample-violations.md 10 Elastic.Wordiness Consider using 'to' instead of 'In order to'.
vale/test-fixtures/sample-violations.md 10 Elastic.Wordiness Consider using 'because' instead of 'due to the fact that'.
vale/test-fixtures/sample-violations.md 10 Elastic.Wordiness Consider using 'many' instead of 'a large number of'.
vale/test-fixtures/sample-violations.md 12 Elastic.Exclamation Use exclamation points sparingly. Consider removing the exclamation point.
vale/test-fixtures/sample-violations.md 12 Elastic.Exclamation Use exclamation points sparingly. Consider removing the exclamation point.
vale/test-fixtures/sample-violations.md 28 Elastic.WordChoice Consider using 'efficiently' instead of 'Simply', unless the term is in the UI.
vale/test-fixtures/sample-violations.md 28 Elastic.WordChoice Consider using 'allowlist' instead of 'whitelist', unless the term is in the UI.
vale/test-fixtures/sample-violations.md 28 Elastic.WordChoice Consider using 'blocklist' instead of 'blacklist', unless the term is in the UI.
vale/test-fixtures/sample-violations.md 28 Elastic.WordChoice Consider using 'efficient' instead of 'easy', unless the term is in the UI.
vale/test-fixtures/sample-violations.md 32 Elastic.OxfordComma Use the Oxford comma in 'reading, writing and executing.'.
vale/test-fixtures/sample-violations.md 36 Elastic.Wordiness Consider using 'to' instead of 'In order to'.
vale/test-fixtures/sample-violations.md 36 Elastic.Wordiness Consider using 'because' instead of 'due to the fact that'.
vale/test-fixtures/sample-violations.md 36 Elastic.Wordiness Consider using 'many' instead of 'a large number of'.
vale/test-fixtures/sample-violations.md 44 Elastic.Exclamation Use exclamation points sparingly. Consider removing the exclamation point.
vale/test-fixtures/sample-violations.md 44 Elastic.Exclamation Use exclamation points sparingly. Consider removing the exclamation point.

The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

@theletterf theletterf self-assigned this Jun 22, 2026
@theletterf theletterf added the fix label Jun 22, 2026
@theletterf
theletterf merged commit a856092 into main Jun 22, 2026
13 of 14 checks passed
@theletterf
theletterf deleted the fix/vale-arg-list-too-long branch June 22, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edge case: Argument list too long for PR with massive amount of generated files

2 participants