Skip to content

chore: keep the trailing-whitespace hook off the generated GraphQL parser - #11542

Merged
lvca merged 1 commit into
mainfrom
fix/graphql-parser-trailing-whitespace
Nov 12, 2026
Merged

lvca merged 1 commit into
mainfrom
fix/graphql-parser-trailing-whitespace

Conversation

@lvca

@lvca lvca commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What

Excludes the JavaCC-generated GraphQLParser*.java files from the trailing-whitespace pre-commit hook.

Why

JavaCC writes its token tables as 0x0L, (with a space after each comma). The graphql build regenerates the parser whenever graphql.jjt is newer than the generated sources, so every grammar change puts the whitespace back and the lint job goes red. This has happened twice: #9224 stripped it by hand, then #11525 (for #11447/#11451/#11452) merged it back and main's lint was red at 880f335 until #11540 stripped it again.

The exclude is limited to the generated GraphQLParser* files. Hand-written parser node classes and graphql.jjt stay covered, and so do all the other hooks (end-of-file, mixed line endings).

Verification

  • pre-commit run --files .pre-commit-config.yaml: all hooks pass, check-yaml included.
  • I restored 880f335's GraphQLParserTokenManager.java (20 lines with trailing whitespace) and ran pre-commit run trailing-whitespace on it. The hook reports "no files to check" and leaves the file untouched.
  • The regex matches GraphQLParser.java, GraphQLParserTokenManager.java and GraphQLParserConstants.java, and does not match IntValue.java or graphql.jjt.

Summary by CodeRabbit

  • Chores
    • Excluded generated GraphQL parser files from trailing-whitespace checks.

…rser

JavaCC writes its token tables with a space after each comma and the build regenerates the GraphQL parser whenever graphql.jjt is newer than it, so each grammar change brought the whitespace back and turned main's lint red (#9224, then #11525 until #11540 stripped it again).
@lvca lvca added this to the 26.12.1 milestone Nov 12, 2026
@lvca lvca self-assigned this Nov 12, 2026
@mergify

mergify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The pre-commit trailing-whitespace hook now excludes generated GraphQL parser Java files matching a filename pattern. Comments note that JavaCC regenerates these files and restores whitespace after commas.

Changes: Generated GraphQL Parser Whitespace

Layer / File(s) Summary
Exclude generated parser files
.pre-commit-config.yaml
The trailing-whitespace hook excludes matching generated GraphQL parser Java files. Comments describe their regeneration and whitespace behavior.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

  • ArcadeData/arcadedb#11540: Removes trailing whitespace from generated parser files to address the same lint failure through a different approach.
  • ArcadeData/arcadedb#11525: Regenerates GraphQL parser files after a grammar change; this PR’s exclusion applies to generated output.

Suggested reviewers: robfrank

Merge Risk: Minimal · up to 2cb5b

This change keeps a lint hook from failing on regenerated parser files. It does not affect runtime behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the trailing-whitespace pre-commit hook now skips the generated GraphQL parser files. The changeset adds one exclude rule to .pre-commit-config.yaml, so the title matc…
Description check Passed The description follows the required structure only in part. It has a 'What' section that states the change and a 'Why' section that gives the motivation, which map to 'What does this PR do?' and 'Mot…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the trailing-whitespace pre-commit hook now skips the generated GraphQL parser files. The changeset adds one exclude rule to .pre-commit-config.yaml, so the title matches it. The 'chore:' prefix is a conventional-commit type and does not affect the match. The title is 73 characters, which is slightly long but readable.

Full details: Description check

Explanation

The description follows the required structure only in part. It has a 'What' section that states the change and a 'Why' section that gives the motivation, which map to 'What does this PR do?' and 'Motivation'. It has a 'Verification' section, which the template does not include. It has no 'Related issues' section, although the Why section cites #9224, #11525, #11447, #11451, #11452 and #11540 in prose. It has no 'Additional Notes' section. The Checklist is missing. The author does not state that the 'mvn clean package' build was run. The unit-test checkbox does not apply to this change, but the template still expects it to be addressed. The description is mostly complete on substance. The missing template sections are non-critical for a small configuration change.

Resolution

Optionally add a 'Related issues' list (for example #9224, #11525, #11540) and an 'Additional Notes' section. Add the Checklist, marking the build item or stating why it does not apply, since this change only edits the pre-commit configuration.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 15d0602a-ea71-47f3-962d-5c31df01c369
Commits

Reviewing files that changed from the base of the PR and between 147630b and 2cb5b89.

Files selected for processing: 1

  • .pre-commit-config.yaml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@claude

claude Bot commented Nov 12, 2026

Copy link
Copy Markdown

Reviewed: a small, well-scoped config change. The exclude regex is limited to the generated GraphQLParser*.java files, and the other hooks and hand-written parser classes stay covered. The comment explains why, and the verification in the description is sound. I found no security, performance or test concerns, and no tests are needed for a lint config. LGTM.

@codacy-production

codacy-production Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Coverage ∅ diff coverage · -4.40% coverage variation

Metric Results
Coverage variation ✅ -4.40% coverage variation
Diff coverage ✅ ∅ diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (147630b) 282225 248488 88.05%
Head commit (2cb5b89) 315824 (+33599) 264187 (+15699) 83.65% (-4.40%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#11542) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.98%. Comparing base (147630b) to head (2cb5b89).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11542      +/-   ##
==========================================
- Coverage   79.99%   79.98%   -0.01%     
==========================================
  Files        2457     2457              
  Lines      282225   282225              
  Branches    62038    62038              
==========================================
- Hits       225758   225741      -17     
- Misses      33779    33791      +12     
- Partials    22688    22693       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lvca
lvca merged commit a63d29b into main Nov 12, 2026
40 of 43 checks passed
@lvca
lvca deleted the fix/graphql-parser-trailing-whitespace branch November 12, 2026 07:25
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.

1 participant