summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-06-20 09:39:58 +0100
committerw0rp <devw0rp@gmail.com>2017-06-20 09:39:58 +0100
commitb96f5845ed7594cdc38355f6fae49a55a3725b2c (patch)
treeae6027c5636272c3bc39bbefe9ed5abf576aed5e /test
parentb44bd4e24f0c5cf139c428c1239307f3428a0af4 (diff)
downloadale-b96f5845ed7594cdc38355f6fae49a55a3725b2c.zip
Fix #667 - Do not add extra blank lines for add_blank_lines_for_python_control_statements
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_python_add_blank_lines_fixer.vader26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixers/test_python_add_blank_lines_fixer.vader b/test/fixers/test_python_add_blank_lines_fixer.vader
index 04ae8b45..4a91aa10 100644
--- a/test/fixers/test_python_add_blank_lines_fixer.vader
+++ b/test/fixers/test_python_add_blank_lines_fixer.vader
@@ -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()