mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Enable notebooks by default in preview mode (#12621)
This commit is contained in:
parent
fbab04fbe1
commit
012198a1b0
5 changed files with 142 additions and 4 deletions
|
@ -230,9 +230,15 @@ impl Configuration {
|
|||
extend_exclude: FilePatternSet::try_from_iter(self.extend_exclude)?,
|
||||
extend_include: FilePatternSet::try_from_iter(self.extend_include)?,
|
||||
force_exclude: self.force_exclude.unwrap_or(false),
|
||||
include: FilePatternSet::try_from_iter(
|
||||
self.include.unwrap_or_else(|| INCLUDE.to_vec()),
|
||||
)?,
|
||||
include: FilePatternSet::try_from_iter(self.include.unwrap_or_else(|| {
|
||||
let mut include = INCLUDE.to_vec();
|
||||
|
||||
if global_preview.is_enabled() {
|
||||
include.push(FilePattern::Builtin("*.ipynb"));
|
||||
}
|
||||
|
||||
include
|
||||
}))?,
|
||||
respect_gitignore: self.respect_gitignore.unwrap_or(true),
|
||||
project_root: project_root.to_path_buf(),
|
||||
},
|
||||
|
|
|
@ -241,6 +241,10 @@ pub struct Options {
|
|||
/// included here not for configuration but because we lint whether e.g. the
|
||||
/// `[project]` matches the schema.
|
||||
///
|
||||
/// If [preview](https://docs.astral.sh/ruff/preview/) is enabled, the default
|
||||
/// includes notebook files (`.ipynb` extension). You can exclude them by adding
|
||||
/// `*.ipynb` to [`extend-exclude`](#extend-exclude).
|
||||
///
|
||||
/// For more information on the glob syntax, refer to the [`globset` documentation](https://docs.rs/globset/latest/globset/#syntax).
|
||||
#[option(
|
||||
default = r#"["*.py", "*.pyi", "**/pyproject.toml"]"#,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue