Compare commits

..

2 Commits

Author SHA1 Message Date
Charlie Marsh
de89948b6c Re-enable Sphinx in ecosystem checks 2024-05-18 23:31:16 -04:00
Charlie Marsh
24899efe50 Remove example from tab-indentation (#11462)
## Summary

I think the example is more confusing than helpful, since there's no
visual difference between the tab and space here (even if it rendered
properly).

Closes
https://github.com/astral-sh/ruff/issues/11460#issuecomment-2118397278.
2024-05-17 17:49:16 -04:00
5 changed files with 13 additions and 31 deletions

View File

@@ -401,10 +401,7 @@ pub(crate) fn format_source(
// Format the cell.
let formatted =
format_module_source(unformatted, options.clone()).map_err(|err| {
if let FormatModuleError::ParseError(mut err) = err {
// Offset the error location by the start offset of the cell to report
// the correct cell index.
err.location += start;
if let FormatModuleError::ParseError(err) = err {
DisplayParseError::from_source_kind(
err,
path.map(Path::to_path_buf),

View File

@@ -253,7 +253,7 @@ impl Display for DisplayParseError {
ErrorLocation::Cell(cell, location) => {
write!(
f,
"cell {cell}{colon}{row}{colon}{column}{colon} {inner}",
"{cell}{colon}{row}{colon}{column}{colon} {inner}",
cell = cell,
row = location.row,
column = location.column,

View File

@@ -11,18 +11,6 @@ use ruff_text_size::{TextRange, TextSize};
/// According to [PEP 8], spaces are preferred over tabs (unless used to remain
/// consistent with code that is already indented with tabs).
///
/// ## Example
/// ```python
/// if True:
/// a = 1
/// ```
///
/// Use instead:
/// ```python
/// if True:
/// a = 1
/// ```
///
/// ## Formatter compatibility
/// We recommend against using this rule alongside the [formatter]. The
/// formatter enforces consistent indentation, making the rule redundant.

View File

@@ -73,19 +73,17 @@ DEFAULT_TARGETS = [
Project(
repo=Repository(owner="scikit-build", name="scikit-build-core", ref="main")
),
# TODO(charlie): Ecosystem check fails in non-preview due to the direct
# selection of preview rules.
# Project(
# repo=Repository(
# owner="sphinx-doc",
# name="sphinx",
# ref="master",
# ),
# format_options=FormatOptions(
# # Does not contain valid UTF-8
# exclude="tests/roots/test-pycode/cp_1251_coded.py"
# ),
# ),
Project(
repo=Repository(
owner="sphinx-doc",
name="sphinx",
ref="master",
),
format_options=FormatOptions(
# Does not contain valid UTF-8
exclude="tests/roots/test-pycode/cp_1251_coded.py"
),
),
Project(repo=Repository(owner="spruceid", name="siwe-py", ref="main")),
Project(repo=Repository(owner="tiangolo", name="fastapi", ref="master")),
Project(repo=Repository(owner="yandex", name="ch-backup", ref="main")),

View File

@@ -74,7 +74,6 @@ KNOWN_FORMATTING_VIOLATIONS = [
"redundant-backslash",
"shebang-leading-whitespace",
"surrounding-whitespace",
"tab-indentation",
"too-few-spaces-before-inline-comment",
"too-many-blank-lines",
"too-many-boolean-expressions",