Use a platform-appropriate location for user configuration (#215)

This commit is contained in:
Anders Kaseorg
2022-09-17 12:29:17 -07:00
committed by GitHub
parent b8f878df5e
commit f2fd7335ce

View File

@@ -67,7 +67,10 @@ fn find_pyproject_toml(path: Option<&Path>) -> Option<PathBuf> {
}
fn find_user_pyproject_toml() -> Option<PathBuf> {
dirs::home_dir().map(|path| path.join(".ruff"))
let mut path = dirs::config_dir()?;
path.push("ruff");
path.push("pyproject.toml");
Some(path)
}
fn find_project_root(sources: &[PathBuf]) -> Option<PathBuf> {