Set a default on PythonVersion (#6446)

## Summary

I think it makes sense for `PythonVersion::default()` to return our
minimum-supported non-EOL version.

## Test Plan

`cargo test`

---------

Co-authored-by: Zanie <contact@zanie.dev>
This commit is contained in:
Charlie Marsh 2023-08-09 11:19:27 -04:00 committed by GitHub
parent e4f57434a2
commit 38b9fb8bbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 6 deletions

View file

@ -20,6 +20,7 @@ use ruff::rules::{
};
use ruff::settings::configuration::Configuration;
use ruff::settings::options::Options;
use ruff::settings::types::PythonVersion;
use ruff::settings::{defaults, flags, Settings};
use ruff_python_ast::PySourceType;
use ruff_python_codegen::Stylist;
@ -134,7 +135,7 @@ impl Workspace {
line_length: Some(LineLength::default()),
select: Some(defaults::PREFIXES.to_vec()),
tab_size: Some(TabSize::default()),
target_version: Some(defaults::TARGET_VERSION),
target_version: Some(PythonVersion::default()),
// Ignore a bunch of options that don't make sense in a single-file editor.
cache_dir: None,
exclude: None,