Compare commits

..

6 Commits

Author SHA1 Message Date
konsti
2a65e6fc38 Explain check_docs_formatted.py error message (#6125)
## Summary

This is an error message only change to lead an implementor of a new
rule that has an unformatted or invalid bad example to the
right code.

## Test Plan

n/a
2023-07-27 10:22:13 -04:00
Charlie Marsh
13af91299d Avoid walking past root when resolving imports (#6126)
## Summary

Noticed in #5954: we walk _past_ the root rather than stopping _at_ the
root when attempting to traverse along the parent path. It's effectively
an off-by-one bug.
2023-07-27 10:22:13 -04:00
konsti
d317af442f Fix windows test warnings (#6124)
See
https://github.com/astral-sh/ruff/actions/runs/5679922286/job/15392998698.
These didn't fail CI because we run clippy on linux only.
2023-07-27 10:22:13 -04:00
Micha Reiser
6bf6646c5d Respect indent when measuring with MeasureMode::AllLines (#6120) 2023-07-27 10:22:13 -04:00
konsti
9574ff3dc7 Unbreak main (#6123)
This fixes main breaking due to two merges.
2023-07-27 10:22:13 -04:00
konsti
06d9ff9577 Don't format trailing comma for lambda arguments (#5946)
**Summary** lambda arguments don't have parentheses, so they shouldn't
get a magic trailing comma either. This fixes some unstable formatting

**Test Plan** Added a regression test.

89 (from previously 145) instances of unstable formatting remaining.

```
$ cargo run --bin ruff_dev --release -- format-dev --stability-check --error-file formatter-ecosystem-errors.txt --multi-project target/checkouts > formatter-ecosystem-progress.txt
$ rg "Unstable formatting" target/formatter-ecosystem-errors.txt | wc -l
89
```

Closes #5892
2023-07-27 10:22:13 -04:00
115 changed files with 115 additions and 114 deletions

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/context.rs
source: crates/ruff_python_parser/src/context.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/function.rs
source: crates/ruff_python_parser/src/function.rs
expression: parse_ast
---
Ok(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
Dict(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
Call(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
Module(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
BoolOp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
BoolOp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
DictComp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
ListComp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[]

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
GeneratorExp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
GeneratorExp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
ListComp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
GeneratorExp(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
Subscript(

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/parser.rs
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: "parse_fstring(\"\").unwrap()"
---
[]

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

View File

@@ -1,5 +1,5 @@
---
source: ruff_python_parser/src/string.rs
source: crates/ruff_python_parser/src/string.rs
expression: parse_ast
---
[

Some files were not shown because too many files have changed in this diff Show More