Browse code

Remove tab check from validate-modules.

It is redundant with the pycodestyle W191 "indentation contains tabs" check.

Matt Clay authored on 2018/05/22 05:54:15
Showing 2 changed files
... ...
@@ -121,7 +121,6 @@ Errors
121 121
 ---------   -------------------
122 122
   **4xx**   **Syntax**
123 123
   401       Python ``SyntaxError`` while parsing module
124
-  402       Indentation contains tabs
125 124
   403       Type comparison using ``type()`` found. Use ``isinstance()`` instead
126 125
   ..
127 126
 ---------   -------------------
... ...
@@ -396,19 +396,6 @@ class ModuleValidator(Validator):
396 396
                         'https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html#copyright'
397 397
                 )
398 398
 
399
-    def _check_for_tabs(self):
400
-        for line_no, line in enumerate(self.text.splitlines()):
401
-            indent = INDENT_REGEX.search(line)
402
-            if indent and '\t' in line:
403
-                index = line.index('\t')
404
-                self.reporter.error(
405
-                    path=self.object_path,
406
-                    code=402,
407
-                    msg='indentation contains tabs',
408
-                    line=line_no + 1,
409
-                    column=index
410
-                )
411
-
412 399
     def _find_blacklist_imports(self):
413 400
         for child in self.ast.body:
414 401
             names = []
... ...
@@ -1358,7 +1345,6 @@ class ModuleValidator(Validator):
1358 1358
             main = self._find_main_call()
1359 1359
             self._find_module_utils(main)
1360 1360
             self._find_has_import()
1361
-            self._check_for_tabs()
1362 1361
             first_callable = self._get_first_callable()
1363 1362
             self._ensure_imports_below_docs(doc_info, first_callable)
1364 1363