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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

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> {