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

feat(rome_cli): enable organize imports via CLI/configuration #4191

Merged
merged 4 commits into from
Feb 20, 2023

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Feb 7, 2023

Summary

This PR adds support for sorting imports via CLI and configuration.

The sorting of imports will be part of the check command, as it's best suited for the analyzer (relative discussion about the reasons #3978).

As for now, there's no configuration in particular for the sort of imports, we should hold onto that and add a new configuration once we think that the algorithm is stable.

Here's the list of changes:

  • added a new option --organize-imports-enabled for the rome ci command;
  • added a new organizeImports section in the configuration file;
  • updated the fix_all function in the JavaScript file handlers, which will include the correctness/organizeImports rule if the option is enabled;

Test Plan

Added new tests to cover the new scenarios

Documentation

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

@netlify
Copy link

netlify bot commented Feb 7, 2023

Deploy Preview for docs-rometools canceled.

Name Link
🔨 Latest commit 9339a6c
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/63ee187fe00c170008af752e

@ematipico ematipico force-pushed the feat/organize-imports branch from 4fa38cf to 29b498e Compare February 7, 2023 13:00
@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 48647 48647 0
Passed 47582 47582 0
Failed 1065 1065 0
Panics 0 0 0
Coverage 97.81% 97.81% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6093 6093 0
Passed 1783 1783 0
Failed 4310 4310 0
Panics 0 0 0
Coverage 29.26% 29.26% 0.00%

ts/babel

Test result main count This PR count Difference
Total 639 639 0
Passed 567 567 0
Failed 72 72 0
Panics 0 0 0
Coverage 88.73% 88.73% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16740 16740 0
Passed 12816 12816 0
Failed 3924 3924 0
Panics 0 0 0
Coverage 76.56% 76.56% 0.00%

@ematipico ematipico marked this pull request as ready for review February 15, 2023 18:52
@ematipico ematipico force-pushed the feat/organize-imports branch from 683221f to 9339a6c Compare February 16, 2023 11:50
@ematipico ematipico added this pull request to the merge queue Feb 20, 2023
Merged via the queue into main with commit 7140023 Feb 20, 2023
@ematipico ematipico deleted the feat/organize-imports branch February 20, 2023 09:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载