mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-30 15:17:40 +00:00
Rename Notebook related symbols (#6862)
This PR renames the following symbols: * `PySourceType::Jupyter` -> `PySourceType::Ipynb` * `SourceKind::Jupyter` -> `SourceKind::IpyNotebook` * `JupyterIndex` -> `NotebookIndex`
This commit is contained in:
parent
61b2ffa8e8
commit
d1f07008f7
11 changed files with 41 additions and 41 deletions
|
@ -58,7 +58,7 @@ pub enum PySourceType {
|
|||
#[default]
|
||||
Python,
|
||||
Stub,
|
||||
Jupyter,
|
||||
Ipynb,
|
||||
}
|
||||
|
||||
impl PySourceType {
|
||||
|
@ -70,8 +70,8 @@ impl PySourceType {
|
|||
matches!(self, PySourceType::Stub)
|
||||
}
|
||||
|
||||
pub const fn is_jupyter(&self) -> bool {
|
||||
matches!(self, PySourceType::Jupyter)
|
||||
pub const fn is_ipynb(&self) -> bool {
|
||||
matches!(self, PySourceType::Ipynb)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@ impl From<&Path> for PySourceType {
|
|||
fn from(path: &Path) -> Self {
|
||||
match path.extension() {
|
||||
Some(ext) if ext == "pyi" => PySourceType::Stub,
|
||||
Some(ext) if ext == "ipynb" => PySourceType::Jupyter,
|
||||
Some(ext) if ext == "ipynb" => PySourceType::Ipynb,
|
||||
_ => PySourceType::Python,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue