Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ jobs:
- name: Run typecheck and linter
run: |
cd packages/${{ matrix.package-name }}
yarn lint
yarn lint --fix
git diff --exit-code . || (echo "Lint errors found in package ${{ matrix.package-name }}" && exit 1)
Comment on lines +476 to +477

@coderabbitai coderabbitai Bot Jan 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

The diff is not actually displayed to developers.

The PR title states "Show lint errors as diff if they are fixable," but git diff --exit-code . only checks whether files changed—it doesn't display the diff to developers. When this check fails, developers will see a generic error message but won't know what changes the linter made, requiring them to run yarn lint --fix locally to discover the issues.

Consider capturing and displaying the diff in the CI output before failing:

📋 Proposed fix to display the diff
-          yarn lint --fix
-          git diff --exit-code . || (echo "Lint errors found in package ${{ matrix.package-name }}" && exit 1)
+          yarn lint --fix
+          if ! git diff --exit-code .; then
+            echo "Lint errors found in package ${{ matrix.package-name }}. The following changes would be applied:"
+            git diff .
+            exit 1
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
yarn lint --fix
git diff --exit-code . || (echo "Lint errors found in package ${{ matrix.package-name }}" && exit 1)
yarn lint --fix
if ! git diff --exit-code .; then
echo "Lint errors found in package ${{ matrix.package-name }}. The following changes would be applied:"
git diff .
exit 1
fi
🤖 Prompt for AI Agents
In @.github/workflows/node.yaml around lines 476 - 477, Replace the current
post-lint check that only runs "git diff --exit-code ." with a step that
captures and prints the diff before failing: run a git diff (or git --no-pager
diff) to store the patch output and echo it to the job log when non-empty, then
exit with a non-zero code; update the failing command (the line using "git diff
--exit-code . || (echo ... && exit 1)") to instead run the diff, print the diff
content with a clear header (e.g., "Lint changes:"), and then exit 1 if the diff
is non-empty so developers can see exactly what yarn lint --fix changed.

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.

It does display the diff. It's confusing git diff --exit-code which shows the diff as normal but also sets an exit code, and git diff --quiet, which sets the exit code and hides the diff. You can see it works from the screenshots.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@rjmunro, you're absolutely right—I apologize for the confusion! git diff --exit-code does indeed display the diff output while also setting a non-zero exit code when differences exist. I mistakenly conflated it with git diff --quiet, which suppresses output.

Your implementation is correct as-is and will show developers exactly what lint changes were made before failing the CI job. Thank you for the clarification and for catching my error!

🐰💡
((
( -.-)
o_(")(")
learning moment

env:
CI: true

Expand Down
Loading