mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 20:54:26 +08:00
Fix #667 - Do not add extra blank lines for add_blank_lines_for_python_control_statements
This commit is contained in:
@@ -83,3 +83,29 @@ Expect python(Newlines should be added):
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
|
||||
Given python(A file with a main block):
|
||||
import os
|
||||
|
||||
|
||||
def main():
|
||||
print('hello')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Execute(Fix the file):
|
||||
let g:ale_fixers = {'python': ['add_blank_lines_for_python_control_statements']}
|
||||
ALEFix
|
||||
|
||||
Expect python(extra newlines shouldn't be added to the main block):
|
||||
import os
|
||||
|
||||
|
||||
def main():
|
||||
print('hello')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user