mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-29 19:17:20 +00:00
Remove deprecated macOS config file discovery (#19210)
## Summary In #11115 we moved from defaulting to $HOME/Library/Application Support to $XDG_HOME on macOS and added a deprecation warning if we find files in the old location. So this PR removes the warning closes #19145 ## Test Plan Ran `cargo test`
This commit is contained in:
parent
307b7df027
commit
ee448eab2d
1 changed files with 0 additions and 18 deletions
|
|
@ -114,7 +114,6 @@ pub fn find_fallback_target_version<P: AsRef<Path>>(path: P) -> Option<PythonVer
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
pub fn find_user_settings_toml() -> Option<PathBuf> {
|
pub fn find_user_settings_toml() -> Option<PathBuf> {
|
||||||
use etcetera::BaseStrategy;
|
use etcetera::BaseStrategy;
|
||||||
use ruff_linter::warn_user_once;
|
|
||||||
|
|
||||||
let strategy = etcetera::base_strategy::choose_base_strategy().ok()?;
|
let strategy = etcetera::base_strategy::choose_base_strategy().ok()?;
|
||||||
let config_dir = strategy.config_dir().join("ruff");
|
let config_dir = strategy.config_dir().join("ruff");
|
||||||
|
|
@ -127,23 +126,6 @@ pub fn find_user_settings_toml() -> Option<PathBuf> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// On macOS, we used to support reading from `/Users/Alice/Library/Application Support`.
|
|
||||||
if cfg!(target_os = "macos") {
|
|
||||||
let strategy = etcetera::base_strategy::Apple::new().ok()?;
|
|
||||||
let deprecated_config_dir = strategy.data_dir().join("ruff");
|
|
||||||
|
|
||||||
for file in [".ruff.toml", "ruff.toml", "pyproject.toml"] {
|
|
||||||
let path = deprecated_config_dir.join(file);
|
|
||||||
if path.is_file() {
|
|
||||||
warn_user_once!(
|
|
||||||
"Reading configuration from `~/Library/Application Support` is deprecated. Please move your configuration to `{}/{file}`.",
|
|
||||||
config_dir.display(),
|
|
||||||
);
|
|
||||||
return Some(path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue