Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pycodestyle] Add blank line(s) rules (E301, E302, E303, E304, E305, E306) #8720

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
32ec9e7
Add V1 version.
hoel-bagard Nov 9, 2023
624c7a5
Keep track of previous streak of blank lines to fix 301.
hoel-bagard Nov 10, 2023
cd02e11
Fix 302.
hoel-bagard Nov 12, 2023
f9a19ef
Fix 305.
hoel-bagard Nov 12, 2023
a10bea3
Fix 306.
hoel-bagard Nov 12, 2023
f57b614
Fix 303 regression.
hoel-bagard Nov 12, 2023
42c6f12
Add snapshots.
hoel-bagard Nov 12, 2023
2283019
Update nursery rules list
hoel-bagard Nov 12, 2023
06618c2
Add a non-error test and its corresponding fix.
hoel-bagard Nov 12, 2023
09b6ba1
Add a TODO comment.
hoel-bagard Nov 12, 2023
1bdd181
Update snapshots following 06618c2.
hoel-bagard Nov 12, 2023
2a7b4cb
Clippy fixes.
hoel-bagard Nov 12, 2023
aa7b6e6
Store line.is_comment_only()'s result in a variable. Use config more.
hoel-bagard Nov 16, 2023
8d3744d
Do not ignore first logical line when it comes to tracked vars.
hoel-bagard Nov 16, 2023
d670100
Merge branch 'astral-sh:main' into add_blank_lines_E30_V2
hoel-bagard Nov 16, 2023
bd282ec
Remove unnecessary check.
hoel-bagard Nov 16, 2023
2ef4d02
Update snapshots (Fix -> Safe fix)
hoel-bagard Nov 16, 2023
36d2547
Fix first logical line issue.
hoel-bagard Nov 16, 2023
0f61011
Fix false positive caused by a class's docstring.
hoel-bagard Nov 16, 2023
0e9ca4e
Only trigger E302 on non-indented classes/functions.
hoel-bagard Nov 16, 2023
3f6f207
Fix decorator linked false positive.
hoel-bagard Nov 16, 2023
b667c5c
Fix E301 false positive.
hoel-bagard Nov 17, 2023
0bf4c45
Fix decorator + async false positive.
hoel-bagard Nov 18, 2023
7de1e05
Fix E302 error message.
hoel-bagard Nov 18, 2023
0c1450a
Improve E302's fix interaction with comments.
hoel-bagard Nov 18, 2023
7b9b277
Fix E301 regression and improve E301 fix.
hoel-bagard Nov 18, 2023
1d7b235
Fix E302 fix's interaction with comments.
hoel-bagard Nov 18, 2023
73e5ba9
Clippy fix.
hoel-bagard Nov 18, 2023
c1a7a7c
Fix docstring + comment leading to false positive.
hoel-bagard Nov 19, 2023
b484ca4
Fix E305 false positive for indented classes/defs
hoel-bagard Nov 19, 2023
6d0fbf2
Make rules independent.
hoel-bagard Nov 19, 2023
f7b2f89
Fix typo.
hoel-bagard Nov 19, 2023
5365830
Rule simplification.
hoel-bagard Nov 19, 2023
bafddf9
Fix E306 false negative when using async or decorator.
hoel-bagard Nov 19, 2023
ea9d9c8
Simplify/fix E301's condition.
hoel-bagard Nov 19, 2023
4d2f7b5
Make if condition more readable.
hoel-bagard Nov 19, 2023
0867011
Simplify E301's if condition.
hoel-bagard Nov 19, 2023
9f2d339
Remove unnecessary clone.
hoel-bagard Nov 19, 2023
46b0c46
Merge branch 'astral-sh:main' into add_blank_lines_E30_V2
hoel-bagard Nov 19, 2023
3eb5c62
Modify E303 to use top-levelness instead of class/def.
hoel-bagard Nov 21, 2023
9b15d8c
Remove unnecessary clone derive.
hoel-bagard Nov 21, 2023
fd65c70
Update E306
hoel-bagard Nov 24, 2023
883818b
is_first_logical_line -> is_not_first_logical_line to be able to deri…
hoel-bagard Nov 28, 2023
29f0e6b
Remove BlankLinesConfig struct and use module level constants instead.
hoel-bagard Nov 28, 2023
0b6bfdf
Use an enum to keep track of class and fn status.
hoel-bagard Nov 28, 2023
304115a
Remove for loop, clippy fixes.
hoel-bagard Nov 28, 2023
083f4f5
Remove unnecessary Option from is_docstring.
hoel-bagard Nov 28, 2023
60311c3
Use an enum to keep track of what the line is following.
hoel-bagard Nov 28, 2023
dc2fe49
Update crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/b…
hoel-bagard Nov 28, 2023
727a17b
BlankLinesTrackingVars -> BlankLinesChecker
hoel-bagard Nov 28, 2023
cbb6c1b
Add test case
hoel-bagard Dec 16, 2023
29849d5
Merge branch 'astral-sh:main' into add_blank_lines_E30_V2
hoel-bagard Dec 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/flake8_to_ruff/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ mod tests {
pattern: "examples/*".to_string(),
prefix: codes::Pyflakes::_841.into(),
},
PatternPrefixPair {
pattern: "*.pyi".to_string(),
prefix: codes::Pycodestyle::E302.into(),
},
];
assert_eq!(actual, expected);

Expand Down
Loading
Loading