File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
crates/ruff_workspace/src Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ pub fn find_fallback_target_version<P: AsRef<Path>>(path: P) -> Option<PythonVer
114114#[ cfg( not( target_arch = "wasm32" ) ) ]
115115pub fn find_user_settings_toml ( ) -> Option < PathBuf > {
116116 use etcetera:: BaseStrategy ;
117+ use ruff_linter:: warn_user_once;
117118
118119 let strategy = etcetera:: base_strategy:: choose_base_strategy ( ) . ok ( ) ?;
119120 let config_dir = strategy. config_dir ( ) . join ( "ruff" ) ;
@@ -126,6 +127,23 @@ pub fn find_user_settings_toml() -> Option<PathBuf> {
126127 }
127128 }
128129
130+ // On macOS, we used to support reading from `/Users/Alice/Library/Application Support`.
131+ if cfg ! ( target_os = "macos" ) {
132+ let strategy = etcetera:: base_strategy:: Apple :: new ( ) . ok ( ) ?;
133+ let deprecated_config_dir = strategy. data_dir ( ) . join ( "ruff" ) ;
134+
135+ for file in [ ".ruff.toml" , "ruff.toml" , "pyproject.toml" ] {
136+ let path = deprecated_config_dir. join ( file) ;
137+ if path. is_file ( ) {
138+ warn_user_once ! (
139+ "Reading configuration from `~/Library/Application Support` is deprecated. Please move your configuration to `{}/{file}`." ,
140+ config_dir. display( ) ,
141+ ) ;
142+ return Some ( path) ;
143+ }
144+ }
145+ }
146+
129147 None
130148}
131149
You can’t perform that action at this time.
0 commit comments