mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
Update MSRV to 1.85 and toolchain to 1.87 (#18126)
This commit is contained in:
parent
6e39250015
commit
196e4befba
19 changed files with 82 additions and 54 deletions
|
@ -559,7 +559,7 @@ impl DocumentQuery {
|
|||
ruff_linter::source_kind::SourceKind::Python(document.contents().to_string())
|
||||
}
|
||||
Self::Notebook { notebook, .. } => {
|
||||
ruff_linter::source_kind::SourceKind::IpyNotebook(notebook.make_ruff_notebook())
|
||||
ruff_linter::source_kind::SourceKind::ipy_notebook(notebook.make_ruff_notebook())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -462,7 +462,7 @@ impl ConfigurationTransformer for EditorConfigurationTransformer<'_> {
|
|||
tracing::debug!(
|
||||
"Combining settings from editor-specified inline configuration"
|
||||
);
|
||||
match Configuration::from_options(options, None, project_root) {
|
||||
match Configuration::from_options(*options, None, project_root) {
|
||||
Ok(configuration) => editor_configuration.combine(configuration),
|
||||
Err(err) => {
|
||||
tracing::error!(
|
||||
|
@ -516,10 +516,10 @@ mod tests {
|
|||
#[test]
|
||||
fn inline_settings() {
|
||||
let editor_settings = ResolvedEditorSettings {
|
||||
configuration: Some(ResolvedConfiguration::Inline(Options {
|
||||
configuration: Some(ResolvedConfiguration::Inline(Box::new(Options {
|
||||
line_length: Some(LineLength::try_from(120).unwrap()),
|
||||
..Default::default()
|
||||
})),
|
||||
}))),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
@ -534,10 +534,10 @@ mod tests {
|
|||
#[test]
|
||||
fn inline_and_specific_settings_resolution_order() {
|
||||
let editor_settings = ResolvedEditorSettings {
|
||||
configuration: Some(ResolvedConfiguration::Inline(Options {
|
||||
configuration: Some(ResolvedConfiguration::Inline(Box::new(Options {
|
||||
line_length: Some(LineLength::try_from(120).unwrap()),
|
||||
..Default::default()
|
||||
})),
|
||||
}))),
|
||||
line_length: Some(LineLength::try_from(100).unwrap()),
|
||||
..Default::default()
|
||||
};
|
||||
|
|
|
@ -52,7 +52,7 @@ pub(crate) struct ResolvedEditorSettings {
|
|||
#[cfg_attr(test, derive(PartialEq, Eq))]
|
||||
pub(crate) enum ResolvedConfiguration {
|
||||
FilePath(PathBuf),
|
||||
Inline(Options),
|
||||
Inline(Box<Options>),
|
||||
}
|
||||
|
||||
impl TryFrom<&ClientConfiguration> for ResolvedConfiguration {
|
||||
|
@ -68,7 +68,7 @@ impl TryFrom<&ClientConfiguration> for ResolvedConfiguration {
|
|||
if options.extend.is_some() {
|
||||
Err(ResolvedConfigurationError::ExtendNotSupported)
|
||||
} else {
|
||||
Ok(ResolvedConfiguration::Inline(options))
|
||||
Ok(ResolvedConfiguration::Inline(Box::new(options)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -991,7 +991,7 @@ mod tests {
|
|||
fix_violation_enable: true,
|
||||
show_syntax_errors: true,
|
||||
editor_settings: ResolvedEditorSettings {
|
||||
configuration: Some(ResolvedConfiguration::Inline(Options {
|
||||
configuration: Some(ResolvedConfiguration::Inline(Box::new(Options {
|
||||
line_length: Some(LineLength::try_from(100).unwrap()),
|
||||
lint: Some(LintOptions {
|
||||
common: LintCommonOptions {
|
||||
|
@ -1005,7 +1005,7 @@ mod tests {
|
|||
..Default::default()
|
||||
}),
|
||||
..Default::default()
|
||||
})),
|
||||
}))),
|
||||
extend_select: Some(vec![RuleSelector::from_str("RUF001").unwrap()]),
|
||||
..Default::default()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue