ruff
[`pycodestyle`] Add blank line(s) rules (`E301`, `E302`, `E303`, `E304`, `E305`, `E306`)
#9266
Merged

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

hoel-bagard
hoel-bagard Add V1 version.
32ec9e76
hoel-bagard Keep track of previous streak of blank lines to fix 301.
624c7a59
hoel-bagard Fix 302.
cd02e117
hoel-bagard Fix 305.
f9a19ef1
hoel-bagard Fix 306.
a10bea32
hoel-bagard Fix 303 regression.
f57b6142
hoel-bagard Add snapshots.
42c6f12f
hoel-bagard Update nursery rules list
22830193
hoel-bagard Add a non-error test and its corresponding fix.
06618c2f
hoel-bagard Add a TODO comment.
09b6ba1e
hoel-bagard Update snapshots following 06618c2.
1bdd1815
hoel-bagard Clippy fixes.
2a7b4cb9
hoel-bagard Store line.is_comment_only()'s result in a variable. Use config more.
aa7b6e69
hoel-bagard Do not ignore first logical line when it comes to tracked vars.
8d3744d5
hoel-bagard Merge branch 'astral-sh:main' into add_blank_lines_E30_V2
d6701004
hoel-bagard Remove unnecessary check.
bd282ec6
hoel-bagard Update snapshots (Fix -> Safe fix)
2ef4d02a
hoel-bagard Fix first logical line issue.
36d2547a
hoel-bagard Fix false positive caused by a class's docstring.
0f610114
hoel-bagard Only trigger E302 on non-indented classes/functions.
0e9ca4ea
hoel-bagard Fix decorator linked false positive.
3f6f207c
hoel-bagard Fix E301 false positive.
b667c5cb
hoel-bagard Fix decorator + async false positive.
0bf4c45e
hoel-bagard Fix E302 error message.
7de1e058
hoel-bagard Improve E302's fix interaction with comments.
0c1450a7
hoel-bagard Fix E301 regression and improve E301 fix.
7b9b277d
hoel-bagard Fix E302 fix's interaction with comments.
1d7b2353
hoel-bagard Clippy fix.
73e5ba9f
hoel-bagard Fix docstring + comment leading to false positive.
c1a7a7c0
hoel-bagard Fix E305 false positive for indented classes/defs
b484ca4a
hoel-bagard Make rules independent.
6d0fbf2e
hoel-bagard Fix typo.
f7b2f893
hoel-bagard Rule simplification.
53658304
hoel-bagard Fix E306 false negative when using async or decorator.
bafddf94
hoel-bagard Simplify/fix E301's condition.
ea9d9c83
hoel-bagard Make if condition more readable.
4d2f7b5b
hoel-bagard Simplify E301's if condition.
0867011a
hoel-bagard Remove unnecessary clone.
9f2d339f
hoel-bagard Merge branch 'astral-sh:main' into add_blank_lines_E30_V2
46b0c46b
hoel-bagard Modify E303 to use top-levelness instead of class/def.
3eb5c627
hoel-bagard Remove unnecessary clone derive.
9b15d8c0
hoel-bagard Update E306
fd65c701
hoel-bagard is_first_logical_line -> is_not_first_logical_line to be able to deri…
883818b1
hoel-bagard Remove BlankLinesConfig struct and use module level constants instead.
29f0e6b4
hoel-bagard Use an enum to keep track of class and fn status.
0b6bfdf3
hoel-bagard Remove for loop, clippy fixes.
304115ae
hoel-bagard Remove unnecessary Option from is_docstring.
083f4f5f
hoel-bagard Use an enum to keep track of what the line is following.
60311c3f
hoel-bagard Update crates/ruff_linter/src/rules/pycodestyle/rules/logical_lines/b…
dc2fe49c
hoel-bagard BlankLinesTrackingVars -> BlankLinesChecker
727a17bf
hoel-bagard WIP
0635407a
hoel-bagard Started building LogicalLine replacement.
199257d5
hoel-bagard Mostly finished renaming variable.
2002a6bd
hoel-bagard Remove blank line counting in logical lines.
92da66c5
hoel-bagard Bug fixes.
7099fca0
hoel-bagard Clippy fixes.
5a59006f
hoel-bagard Add comment.
f1205a18
hoel-bagard Move the blank_lines outside the logical_lines module.
69279376
hoel-bagard Merge with upstream.
fa558509
hoel-bagard Move check to the tokens' file.
94fe6efe
hoel-bagard hoel-bagard marked this pull request as draft 1 year ago
hoel-bagard Remove unused import.
f2d49574
codspeed-hq
hoel-bagard Fix rule placement in the registry.
c9cf6b65
hoel-bagard Ignore clippy warnings.
6f3aa5cf
github-actions
hoel-bagard Split if conditions into multiple ifs.
55a918da
hoel-bagard Fix 2 false positives linked to indentation.
9f2268c9
hoel-bagard Fix false positive caused by bad async handling.
66f4dd4d
hoel-bagard hoel-bagard marked this pull request as ready for review 1 year ago
hoel-bagard Add test fixture.
3aac64df
hoel-bagard Remove async as a top level token.
b7727c5e
akx
MichaReiser
hoel-bagard hoel-bagard force pushed from ba036d2e to b7727c5e 1 year ago
MichaReiser
MichaReiser commented on 2024-01-10
MichaReiser
MichaReiser commented on 2024-01-10
hoel-bagard Fix is_top_level_token docstring.
ba7d8d72
hoel-bagard Use usize for preceding_blank_characters.
0bcdf7da
MichaReiser
MichaReiser requested changes on 2024-01-10
MichaReiser
MichaReiser commented on 2024-01-10
MichaReiser MichaReiser added rule
hoel-bagard Use TokenKind instead of Tok
ede587a6
hoel-bagard Use == comparison instead of matches! where possible
f3305841
hoel-bagard Use TokenKind::is_trivia to reduce nesting.
4437cc97
hoel-bagard Remove dead if branch.
3647ec55
hoel-bagard Update crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs
26417b91
hoel-bagard Give violations' u32 field a name and make it private.
8bc8960e
hoel-bagard Simplify and explain is_docstring flag detection.
22cd072d
hoel-bagard Replace unwrap by expect.
3f3ccfa8
hoel-bagard check_content -> check_lines
12d80ed6
hoel-bagard Move BlankLinesChecker struct declaration closer to its implementatio…
86c473cb
hoel-bagard Remove unnecessary clip allow.
c347761e
hoel-bagard Passing TokenKind by value.
820480f6
hoel-bagard Remove unnecessary clip allow (too many arguments).
3df1f1b0
hoel-bagard Update crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs
cce4d008
hoel-bagard Update crates/ruff_linter/src/rules/pycodestyle/rules/blank_lines.rs
92fca249
hoel-bagard Revert "Update crates/ruff_linter/src/rules/pycodestyle/rules/blank_l…
8985a398
hoel-bagard Fix visual indent.
3941e8f9
hoel-bagard Fix visual indent.
1831879a
hoel-bagard Revert unrelated variable name change.
52589e43
hoel-bagard Add tests with indentation made of 2 spaces, tabs and mixed spaces an…
4f2c318a
hoel-bagard Do not use an hard coded indent size.
94c9babf
hoel-bagard Fix missing else branch
da11f028
hoel-bagard Remove outdated Async check.
531ce0ed
hoel-bagard Remove unecessary if.
cc81cc36
hoel-bagard Move follow docstring if block outside of comment only if block.
bdfb1e3a
hoel-bagard Remove unecessary comment check condition.
894bc21e
hoel-bagard Only store the last token's end instead of full range.
0f659b96
hoel-bagard
hoel-bagard Rename indent_level to indent_length
0d364444
MichaReiser
hoel-bagard refactor: make current_blank_lines and current_blank_characters into …
60547072
hoel-bagard docs: add docstring to explain the difference between blank_lines and…
4c54d05a
hoel-bagard docs: expand on the previous_blank_lines comment.
c07ccdf9
hoel-bagard refactor: previous_blank_lines -> preceding_blank_lines
5e342ac4
hoel-bagard
hoel-bagard hoel-bagard requested a review from MichaReiser MichaReiser 1 year ago
MichaReiser Merge remote-tracking branch 'origin/main' into blank_lines_non_logical
280ba513
hoel-bagard Fix clippy errors.
273a711a
MichaReiser Introduce `LogicalLineKind`
2fb48bc2
MichaReiser Remove the need for `line_start`
cafe5ff8
MichaReiser
hoel-bagard
MichaReiser Add a few new tests, remove unnecessary `as_str` and `to_string` calls
e739a445
MichaReiser Merge branch 'blank_lines_non_logical' of github.com:hoel-bagard/ruff…
f9a0d2db
MichaReiser
MichaReiser requested changes on 2024-01-15
sihil
MichaReiser
hoel-bagard
hoel-bagard Reorder tests.
b244f22f
MichaReiser
hoel-bagard Add comments to the text fixture.
f8149908
hoel-bagard
hoel-bagard
MichaReiser
hoel-bagard
hoel-bagard
hoel-bagard hoel-bagard force pushed from e8d9ac4a to f8149908 1 year ago
hoel-bagard Use BlankLines enum and keep track of the blank lines range.
2c08381d
hoel-bagard Remove line.blank_lines_len and use BlankLines enum instead.
fddc7401
hoel-bagard Add E304 fixture.
c2f6a0c2
hoel-bagard Improve E304 fix.
7ee8946a
hoel-bagard hoel-bagard force pushed from 695517ce to 7ee8946a 1 year ago
hoel-bagard Match pycodestyle error message for E305.
24bf5859
MichaReiser
hoel-bagard
hoel-bagard hoel-bagard requested a review from MichaReiser MichaReiser 1 year ago
hoel-bagard docs: add comment about preceding_blank_lines vs blank_lines.
71d90576
hoel-bagard hoel-bagard force pushed from 9f4eafad to 71d90576 1 year ago
MichaReiser
hoel-bagard
MichaReiser
MichaReiser Merge branch 'main' into blank_lines_non_logical
181fdee9
MichaReiser Move status update logic into its own function, mark rules as preview
8392f204
MichaReiser Introduce `blank_lines.range` method
0ddcca43
MichaReiser
MichaReiser commented on 2024-02-05
MichaReiser Use `universal_newlines` for decorator fix
de559d8c
MichaReiser
MichaReiser approved these changes on 2024-02-06
MichaReiser Small code simpliciations
db137d91
hoel-bagard
hoel-bagard add wrongly indented comment test
85302d5d
hoel-bagard hoel-bagard force pushed from 6820cbeb to 85302d5d 1 year ago
MichaReiser
MichaReiser MichaReiser added preview
MichaReiser MichaReiser requested a review from charliermarsh charliermarsh 1 year ago
MichaReiser MichaReiser requested a review from zanieb zanieb 1 year ago
zanieb
zanieb commented on 2024-02-06
zanieb
zanieb commented on 2024-02-06
zanieb
zanieb commented on 2024-02-06
zanieb
zanieb commented on 2024-02-06
zanieb
zanieb commented on 2024-02-06
hoel-bagard fix E301 docstring.
3d5cc845
hoel-bagard fix E302 docstring.
0596eda0
hoel-bagard Fix E301's fix message
d188e200
hoel-bagard Fix E304's docstring.
e89c20f8
hoel-bagard Fix error message capitalization.
a28f916c
hoel-bagard hoel-bagard force pushed from ba8ee058 to a28f916c 1 year ago
hoel-bagard hoel-bagard requested a review from zanieb zanieb 1 year ago
MichaReiser Remove unnecessary state variables
aea3493e
MichaReiser MichaReiser enabled auto-merge (squash) 1 year ago
MichaReiser MichaReiser merged 90271691 into main 1 year ago
akx
zanieb
spaceone
hoel-bagard
Sam1320

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone