Skip to content

fix: inventory conditional workspace lint generators - #256

Merged
jan-kubica merged 1 commit into
mainfrom
fix/conditional-lint-generators-20261028
Oct 28, 2026
Merged

jan-kubica merged 1 commit into
mainfrom
fix/conditional-lint-generators-20261028

Conversation

@jan-kubica

Copy link
Copy Markdown
Contributor

Lint inventory rejected a workspace script that changes to the repository root, conditionally runs its generator, and then lints the workspace. Flattening the shell group discarded the successful directory context and tried to resolve the generator in the wrong package.

Recognize the bounded ([ -n "$VARIABLE" ] || bun run <script>) preparation form. Inventory the possible generator branch in its actual workspace and retain its nested lint scopes; do not execute the condition or generator. Command substitutions, directory-changing group bodies, extra arguments and ambiguous outer flow remain rejected. Add lexer regressions and extend the real workspace inventory fixture to prove both the generator and final lint orphans remain visible.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 755986c and 0190538.

Files selected for processing: 5
  • .changeset/conditional-lint-generator-inventory.md
  • packages/oxlint-config/README.md
  • packages/oxlint-config/src/toolchain-lint-command.test.ts
  • packages/oxlint-config/src/toolchain-lint-command.ts
  • packages/oxlint-config/src/toolchain-node-projects.test.ts

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

Recent review details
Context from checks skipped due to timeout: 6
  • GitHub Check: cla/pr-256
  • GitHub Check: Generated setup with PostgreSQL and Valkey
  • GitHub Check: Shared tooling checks
  • GitHub Check: Hawk compiler compatibility
  • GitHub Check: rust-lints
  • GitHub Check: cla / cla
Additional comments: 5
packages/oxlint-config/README.md: 1

1270-1270: LGTM!

packages/oxlint-config/src/toolchain-lint-command.ts: 1

90-93: LGTM!

Also applies to: 134-138, 261-261, 265-265

packages/oxlint-config/src/toolchain-lint-command.test.ts: 1

719-746: LGTM!

Also applies to: 748-769

.changeset/conditional-lint-generator-inventory.md: 1

1-5: LGTM!

packages/oxlint-config/src/toolchain-node-projects.test.ts: 1

1114-1117: LGTM!

Also applies to: 1124-1125, 1139-1139, 1147-1147, 1155-1159, 1160-1173

Walkthrough

The lint inventory now includes possible lint scopes from a bounded conditional Bun generator command. Tests cover command parsing and cross-workspace inventory scenarios.

Changes: Conditional Bun lint inventory

Layer / File(s) Summary
Recognise conditional Bun scripts
packages/oxlint-config/src/toolchain-lint-command.ts, packages/oxlint-config/src/toolchain-lint-command.test.ts, packages/oxlint-config/README.md, .changeset/conditional-lint-generator-inventory.md
The inventory recognises a quoted environment-variable guard followed by one literal bun run script. Tests cover accepted and rejected forms. The README describes the constraints, and the changeset marks a patch release.
Validate workspace inventory
packages/oxlint-config/src/toolchain-node-projects.test.ts
Workspace tests cover generator preparation from different working directories, orphan diagnostics in both workspaces, and cyclic script delegation.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 01905

No merge-blocking risk was identified for conditional generator inventory.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: lint inventory now handles conditional Bun generators in workspace scripts. It follows the conventional commit style and is specific. It is 52 characters and 6 words, …
Description check Passed The description states the problem (lint inventory rejects a workspace script that changes to the repository root, conditionally runs a generator, then lints). It describes the fix: recognising the bo…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: lint inventory now handles conditional Bun generators in workspace scripts. It follows the conventional commit style and is specific. It is 52 characters and 6 words, which fits the concise single-sentence requirement.

Full details: Description check

Explanation

The description states the problem (lint inventory rejects a workspace script that changes to the repository root, conditionally runs a generator, then lints). It describes the fix: recognising the bounded conditional Bun preparation form, inventorying the generator in its real workspace, and adding lexer regressions and fixture coverage. This matches the changeset.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files. (2 skipped: 2 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 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

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

@jan-kubica
jan-kubica force-pushed the fix/conditional-lint-generators-20261028 branch from 43a226f to 0296aec Compare October 28, 2026 08:23
@jan-kubica
jan-kubica marked this pull request as ready for review October 28, 2026 08:24
@jan-kubica
jan-kubica enabled auto-merge October 28, 2026 08:27
@jan-kubica
jan-kubica force-pushed the fix/conditional-lint-generators-20261028 branch from 0296aec to 0190538 Compare October 28, 2026 08:54
@jan-kubica
jan-kubica added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit d83b9ae Oct 28, 2026
13 checks passed
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