This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 659
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rome_cli): correctly compute configuration (#3176)
- Loading branch information
Showing
9 changed files
with
287 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
use crate::{execute_mode, CliSession, Execution, Termination, TraversalMode}; | ||
use rome_service::load_config; | ||
use rome_service::settings::WorkspaceSettings; | ||
use rome_service::workspace::UpdateSettingsParams; | ||
|
||
use super::format::apply_format_settings_from_cli; | ||
|
||
/// Handler for the "ci" command of the Rome CLI | ||
pub(crate) fn ci(mut session: CliSession) -> Result<(), Termination> { | ||
let configuration = load_config(&session.app.fs, None)?; | ||
let mut workspace_settings = WorkspaceSettings::default(); | ||
let configuration = apply_format_settings_from_cli(&mut session, configuration)?; | ||
|
||
if let Some(configuration) = configuration { | ||
session | ||
.app | ||
.workspace | ||
.update_settings(UpdateSettingsParams { configuration })?; | ||
} | ||
apply_format_settings_from_cli(&mut session, &mut workspace_settings)?; | ||
session | ||
.app | ||
.workspace | ||
.update_settings(UpdateSettingsParams { configuration })?; | ||
|
||
execute_mode(Execution::new(TraversalMode::CI), session) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
crates/rome_cli/tests/snapshots/main_format/applies_custom_configuration.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
source: crates/rome_cli/tests/snap_test.rs | ||
expression: content | ||
--- | ||
## `file.js` | ||
|
||
```js | ||
function f() { | ||
return { | ||
a, | ||
b, | ||
}; | ||
} | ||
|
||
``` | ||
|
||
# Emitted Messages | ||
|
||
|
Oops, something went wrong.