Skip to content

fix(schema): reject null relation fields - #2969

Merged
HerringtonDarkholme merged 1 commit into
mainfrom
fix/reject-null-relation-field
Sep 25, 2026
Merged

HerringtonDarkholme merged 1 commit into
mainfrom
fix/reject-null-relation-field

Conversation

@HerringtonDarkholme

@HerringtonDarkholme HerringtonDarkholme commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • remove null from generated Relation.field enums
  • require users to omit field when no field constraint is needed
  • regenerate all 25 language schemas

Context

This revisits #2947. Although Relation.field is represented as an optional value internally, the configuration contract should distinguish omission from an explicit null: users should leave the property out entirely.

The generated enum therefore contains only valid grammar field names. For grammars without named fields, it is empty, so the property must be omitted.

Verification

  • cargo xtask schema
  • cargo test -p xtask
  • cargo fmt --check
  • commit hooks: formatting, cargo check, and Clippy

Summary by CodeRabbit

  • Bug Fixes
    • Rule schemas now accept only defined field names for relation fields; null is no longer accepted. Optional fields should be omitted instead.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7e735965-541f-45b8-bb97-143a8dc89833

📥 Commits

Reviewing files that changed from the base of the PR and between cf48ff4 and 1009df1.

📒 Files selected for processing (26)
  • schemas/bash_rule.json
  • schemas/c_rule.json
  • schemas/cpp_rule.json
  • schemas/csharp_rule.json
  • schemas/css_rule.json
  • schemas/dart_rule.json
  • schemas/elixir_rule.json
  • schemas/go_rule.json
  • schemas/haskell_rule.json
  • schemas/html_rule.json
  • schemas/java_rule.json
  • schemas/javascript_rule.json
  • schemas/json_rule.json
  • schemas/kotlin_rule.json
  • schemas/lua_rule.json
  • schemas/php_rule.json
  • schemas/python_rule.json
  • schemas/ruby_rule.json
  • schemas/rust_rule.json
  • schemas/scala_rule.json
  • schemas/swift_rule.json
  • schemas/tsx_rule.json
  • schemas/typescript_rule.json
  • schemas/yaml_rule.json
  • schemas/zig_rule.json
  • xtask/src/schema.rs
 ____________________________________________
< Rabbit in the repo, here to fix that bug 🎶 >
 --------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

Comment @coderabbitai help to get the list of available commands.

@HerringtonDarkholme
HerringtonDarkholme added this pull request to the merge queue Sep 25, 2026
@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.76%. Comparing base (cf48ff4) to head (1009df1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2969   +/-   ##
=======================================
  Coverage   87.76%   87.76%           
=======================================
  Files         127      127           
  Lines       23219    23219           
=======================================
  Hits        20378    20378           
  Misses       2841     2841           

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

Merged via the queue into main with commit 6602aeb Sep 25, 2026
10 of 11 checks passed
@HerringtonDarkholme
HerringtonDarkholme deleted the fix/reject-null-relation-field branch September 25, 2026 15:23
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