Add Python version support to ruff analyze CLI (#13426)

This commit is contained in:
Charlie Marsh 2024-09-20 15:40:47 -04:00 committed by GitHub
parent 2823487bf8
commit ff11db61b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 30 additions and 6 deletions

View file

@ -54,6 +54,13 @@ impl TryFrom<(&str, &str)> for PythonVersion {
}
}
impl From<(u8, u8)> for PythonVersion {
fn from(value: (u8, u8)) -> Self {
let (major, minor) = value;
Self { major, minor }
}
}
impl fmt::Display for PythonVersion {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let PythonVersion { major, minor } = self;