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

Remove mixed-indentation from the codebase #3578

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ Release date: TBA

* bad-continuation and bad-whitespace have been removed, black or another formatter can help you with this better than Pylint

Close #246, #289, #638, #747, #1148, #1179, #1943, #2041, #2301, #2304, #2944, #3565
Close #246, #289, #638, #747, #1148, #1179, #1943, #2041, #2301, #2304, #2944, #3565

* The no-space-check option has been removed. It's no longer possible to consider empty line like a `trailing-whitespace` by using clever options

Close #1368
Close #1368

* mixed-indentation has been removed, it is no longer useful since TabError is included directly in python3

Close #2984 #3573

What's New in Pylint 2.5.1?
===========================
Expand Down
2 changes: 2 additions & 0 deletions doc/whatsnew/2.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ Other Changes
* `bad-continuation` and `bad-whitespace` have been removed. `black` or another formatter can help you with this better than Pylint

* The `no-space-check` option has been removed, it's no longer possible to consider empty line like a `trailing-whitespace` by using clever options.

* `mixed-indentation` has been removed, it is no longer useful since TabError is included directly in python3
13 changes: 0 additions & 13 deletions pylint/checkers/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,6 @@
"Used when an unexpected number of indentation's tabulations or "
"spaces has been found.",
),
"W0312": (
"Found indentation with %ss instead of %ss",
"mixed-indentation",
"Used when there are some mixed tabs and spaces in a module.",
),
"W0301": (
"Unnecessary semicolon", # was W0106
"unnecessary-semicolon",
Expand Down Expand Up @@ -744,13 +739,6 @@ def check_indent_level(self, string, expected, line_num):
level += 1
suppl = ""
while string and string[0] in " \t":
if string[0] != indent[0]:
if string[0] == "\t":
args = ("tab", "space")
else:
args = ("space", "tab")
self.add_message("mixed-indentation", args=args, line=line_num)
return level
suppl += string[0]
string = string[1:]
if level != expected or suppl:
Expand All @@ -762,7 +750,6 @@ def check_indent_level(self, string, expected, line_num):
line=line_num,
args=(level * unit_size + len(suppl), i_type, expected * unit_size),
)
return None


def register(linter):
Expand Down
10 changes: 0 additions & 10 deletions tests/functional/m/mixed_indentation.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/m/mixed_indentation.txt

This file was deleted.