Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_cli): correctly account for diff diagnostics in the printed diagnostics count #3595

Merged
merged 2 commits into from
Nov 9, 2022

Conversation

leops
Copy link
Contributor

@leops leops commented Nov 8, 2022

Summary

Fixes #3593

This PR adds checks against the printed_diagnostics counter in the console thread for diff diagnostics and general errors. This ensures the CLI never prints more diagnostics than the allowed maximum. I've also extended the --max-diagnostics argument from the check command to the ci and format commands, albeit with a different default value.

Test Plan

I've added new tests for this in the CLI test suite but couldn't use the snapshot testing utility since the CLI runs multithreaded, and as a result the order of diagnostics printed in multiple files (for instance in many files formatted in parallel) is not deterministic and changes from one test run to another.

@leops leops temporarily deployed to netlify-playground November 8, 2022 16:57 Inactive
@netlify
Copy link

netlify bot commented Nov 8, 2022

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit 6e82300
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/636a8a70c92cbb000951b9a1
😎 Deploy Preview https://deploy-preview-3595--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented Nov 8, 2022

@MichaReiser
Copy link
Contributor

Have you tried using the new flags with the CLI by eg. calling it in the webpack or prettier project?

@leops leops merged commit 50dbe68 into main Nov 9, 2022
@leops leops deleted the fix/cli-diagnostic-limit branch November 9, 2022 08:38
@leops
Copy link
Contributor Author

leops commented Nov 9, 2022

Have you tried using the new flags with the CLI by eg. calling it in the webpack or prettier project?

I ran it locally on the repos being used for benchmarking just to be sure, it works as expected

@leops leops added the A-CLI Area: CLI label Nov 9, 2022
@leops leops added this to the 10.0.1 milestone Nov 9, 2022
jeysal added a commit to jeysal/rometools that referenced this pull request Nov 9, 2022
* upstream/main:
  fix(rome_js_analyze): Verify method name of React API calls (rome#3619)
  benchmark: Add pprettier and dprint to benchmark (rome#3597)
  feat(vscode): display the version of the language server in the status bar (rome#3616)
  fix(rome_cli): correctly account for diff diagnostics in the printed diagnostics count (rome#3595)
  fix(rome_cli): Respect formatter/linter `enabled` from configuration (rome#3591)
  Remove dead styles
  [website] Add scroll-padding-top
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Cap console output length when there are many errors
2 participants