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

feat(rome_cli): command rome lint #4629

Merged
merged 2 commits into from
Jun 30, 2023
Merged

feat(rome_cli): command rome lint #4629

merged 2 commits into from
Jun 30, 2023

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Jun 28, 2023

Summary

Close #4452

This PR creates a new command called rome lint. This command runs the rules that belong to the RuleCategorie::Lint category, it doesn't format or anything else.

In this PR, I also started a refactor I had in mind for quite a while: at the moment, the process file logic lives in one single file, and it's tough to maintain because that logic has to handle different types of traversals. The intended refactor is to run a traversal (format, lint, check, ci, etc.) in a different file, one for each traversal type. This will undoubtedly duplicate code, but it will make our lives easier in the long run.

Test Plan

I copied all the tests we had under commands/check.rs and swapped the command to run. I removed those test cases that don't belong to the command (import sorting, format, etc.), and made sure that the majority of the test cases are correct.

@netlify
Copy link

netlify bot commented Jun 28, 2023

Deploy Preview for docs-rometools canceled.

Name Link
🔨 Latest commit 09dde03
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/649ed563f3207a0008ce870c

@github-actions github-actions bot added A-CLI Area: CLI A-LSP Area: language server protocol A-Project Area: project configuration and loading labels Jun 28, 2023
@ematipico ematipico marked this pull request as ready for review June 29, 2023 10:25
@ematipico ematipico merged commit 08ad08f into main Jun 30, 2023
17 checks passed
@ematipico ematipico deleted the feat/rome-lint branch June 30, 2023 13:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI A-LSP Area: language server protocol A-Project Area: project configuration and loading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 New rome lint command
1 participant