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

feat(rome_service, rome_cli): linter via configuration #2866

Merged
merged 10 commits into from
Jul 15, 2022

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Jul 12, 2022

Summary

Closes #2862

This PR introduces a new tool section inside the configuration structure. For now only the field is enabled. The rest of the fields will be added later, once we have support for groups for lint rules.

I updated the TraversalMode, which now has information about the enabled/disabled tools (formatter and linter for now). These information are passed from the configuration file.

I also refactored a bit the TraversalMode, by joining the Check and Fix in a single one. They contain the same information and their difference is really minimal. A new field called should_fix is set to true if --apply argument is passed via CLI.

The configuration is now merged inside the Workspace trait, which now also have the fields enabled.

Test Plan

Added new tests that checks that the linter won't analyze the files if in the configuration we set "enabled": false

@ematipico ematipico requested a review from leops as a code owner July 12, 2022 10:56
@ematipico ematipico temporarily deployed to aws July 12, 2022 10:56 Inactive
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jul 12, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 573f3da
Status: ✅  Deploy successful!
Preview URL: https://e6166b7d.tools-8rn.pages.dev
Branch Preview URL: https://feature-configuration-for-li.tools-8rn.pages.dev

View logs

@ematipico ematipico force-pushed the feature/configuration-for-linter branch from 1df00e4 to 41e7a3c Compare July 12, 2022 10:59
@ematipico ematipico temporarily deployed to aws July 12, 2022 10:59 Inactive
@github-actions
Copy link

github-actions bot commented Jul 12, 2022

crates/rome_cli/src/traversal.rs Outdated Show resolved Hide resolved
crates/rome_cli/src/commands/check.rs Outdated Show resolved Hide resolved
@ematipico ematipico temporarily deployed to aws July 12, 2022 13:15 Inactive
@ematipico ematipico changed the title feat(rome_cli): read configuration file feat(rome_cli): linter configuration Jul 12, 2022
@ematipico ematipico requested a review from leops July 12, 2022 13:33
@ematipico ematipico changed the title feat(rome_cli): linter configuration feat(rome_service, rome_cli): linter via configuration Jul 12, 2022
@ematipico ematipico requested a review from xunilrj July 14, 2022 12:02
@ematipico ematipico merged commit 37063f3 into main Jul 15, 2022
@ematipico ematipico deleted the feature/configuration-for-linter branch July 15, 2022 11: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.

implement the linter configuration, consume it across the application
2 participants