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

feat(rome_cli): rome migrate #4343

Merged
merged 1 commit into from
Apr 14, 2023
Merged

feat(rome_cli): rome migrate #4343

merged 1 commit into from
Apr 14, 2023

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Apr 2, 2023

Summary

This PR adds a command to Rome CLI called rome migrate.

The command intends to migrate Rome's configuration to a new version when breaking changes occur. As for now there aren't any migrations, so the command will always output the same message.

The migration uses the existing analyzer infrastructure of the crate rome_analyzer. Migrations are just Rules under the category RuleCategories::Action. Using this infrastructure, we can name the migrations, document them and use their version.

I took the opportunity to refactor a bit the internals of the CLI:

  • moved diagnostics into a diagnostics.rs file
  • moved the code that does stdin operations into a specific file/function => this will become useful for doing linting via stdin
  • moved the code to migrate the configuration file into a separate file

Test Plan

For now, I just created few test cases

Changelog

  • The PR requires a changelog line

Documentation

  • The PR requires documentation
  • I will create a new PR to update the documentation

@netlify
Copy link

netlify bot commented Apr 2, 2023

Deploy Preview for docs-rometools canceled.

Name Link
🔨 Latest commit 59996fd
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/64391da753ae000008afe1a1

@github-actions github-actions bot added A-CLI Area: CLI A-Diagnostic Area: errors and diagnostics A-LSP Area: language server protocol A-Project Area: project configuration and loading labels Apr 2, 2023
@ematipico ematipico force-pushed the feat/command-migrate branch 3 times, most recently from d6b2170 to 390cb45 Compare April 14, 2023 09:18
@github-actions github-actions bot added the A-Linter Area: linter label Apr 14, 2023
@ematipico ematipico force-pushed the feat/command-migrate branch 2 times, most recently from 908cd3c to f62a072 Compare April 14, 2023 09:29
@ematipico ematipico marked this pull request as ready for review April 14, 2023 09:32
@ematipico
Copy link
Contributor Author

I am going ahead and merging this. There are some changes here that I need to add more features. If you have concerns of feedback, please leave a comment and I will address them.

@ematipico ematipico merged commit cc54eed into main Apr 14, 2023
@ematipico ematipico deleted the feat/command-migrate branch April 14, 2023 12:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI A-Diagnostic Area: errors and diagnostics A-Linter Area: linter 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.

None yet

1 participant