Make call to main() not at bottom an error
This commit is contained in:
parent
bfab54e8f4
commit
b608194e59
1 changed files with 2 additions and 3 deletions
|
@ -4,7 +4,6 @@ from __future__ import print_function
|
|||
|
||||
import os
|
||||
import ast
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
from ansible.utils.module_docs import get_docstring, BLACKLIST_MODULES
|
||||
|
@ -79,8 +78,8 @@ class ModuleValidator(object):
|
|||
if (isinstance(child.value.func, ast.Name) and
|
||||
child.value.func.id == 'main'):
|
||||
lineno = child.lineno
|
||||
if lineno != self.length:
|
||||
self.warnings.append('Call to main() not the last '
|
||||
if lineno < self.length - 1:
|
||||
self.errors.append('Call to main() not the last '
|
||||
'line')
|
||||
|
||||
if not lineno:
|
||||
|
|
Loading…
Reference in a new issue