File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @biomejs/biome " : patch
3+ ---
4+
5+ Fixed [ #7390 ] ( https://github.com/biomejs/biome/issues/7390 ) , where Biome couldn't apply the correct configuration passed via ` --config-path ` .
6+
7+ If you have multiple ** root** configuration files, running any command with ` --config-path ` will now apply the chosen configuration file.
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use crate::logging::LoggingKind;
33use biome_configuration:: ConfigurationPathHint ;
44use biome_diagnostics:: Severity ;
55use bpaf:: Bpaf ;
6- use camino:: Utf8PathBuf ;
6+ use camino:: { Utf8Path , Utf8PathBuf } ;
77use std:: fmt:: { Display , Formatter } ;
88use std:: str:: FromStr ;
99
@@ -100,13 +100,20 @@ pub struct CliOptions {
100100
101101impl CliOptions {
102102 /// Computes the [ConfigurationPathHint] based on the options passed by the user
103- pub ( crate ) fn as_configuration_path_hint ( & self ) -> ConfigurationPathHint {
103+ pub ( crate ) fn as_configuration_path_hint (
104+ & self ,
105+ working_directory : & Utf8Path ,
106+ ) -> ConfigurationPathHint {
104107 match self . config_path . as_ref ( ) {
105108 None => ConfigurationPathHint :: default ( ) ,
106109 Some ( path) => {
107110 let path = Utf8PathBuf :: from ( path) ;
108111 let path = path. strip_prefix ( "./" ) . unwrap_or ( & path) ;
109- ConfigurationPathHint :: FromUser ( path. to_path_buf ( ) )
112+ if path. is_absolute ( ) {
113+ ConfigurationPathHint :: FromUser ( path. to_path_buf ( ) )
114+ } else {
115+ ConfigurationPathHint :: FromUser ( working_directory. join ( path) )
116+ }
110117 }
111118 }
112119 }
Original file line number Diff line number Diff line change @@ -939,8 +939,9 @@ pub(crate) trait CommandRunner: Sized {
939939 workspace : & dyn Workspace ,
940940 cli_options : & CliOptions ,
941941 ) -> Result < ConfiguredWorkspace , CliDiagnostic > {
942+ let working_dir = fs. working_directory ( ) . unwrap_or_default ( ) ;
942943 // Load configuration
943- let configuration_path_hint = cli_options. as_configuration_path_hint ( ) ;
944+ let configuration_path_hint = cli_options. as_configuration_path_hint ( working_dir . as_path ( ) ) ;
944945 let loaded_configuration = load_configuration ( fs, configuration_path_hint) ?;
945946 if self . should_validate_configuration_diagnostics ( ) {
946947 validate_configuration_diagnostics (
@@ -961,7 +962,6 @@ pub(crate) trait CommandRunner: Sized {
961962
962963 let execution = self . get_execution ( cli_options, console, workspace) ?;
963964
964- let working_dir = fs. working_directory ( ) . unwrap_or_default ( ) ;
965965 let root_configuration_dir = configuration_dir_path
966966 . clone ( )
967967 . unwrap_or_else ( || working_dir. clone ( ) ) ;
You can’t perform that action at this time.
0 commit comments