pull/79700/merge
Felix Fontein 1 day ago committed by GitHub
commit ca3a13ae79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
minor_changes:
- "ansible-test shebang sanity test - ignore files in ``files/`` and ``templates/`` in collection roles and integration test targets (https://github.com/ansible/ansible/pull/79700)."

@ -0,0 +1,7 @@
#!/pyth
# Python file with non-standard shebang.
# Since it appears in a files/ or templates/ directory inside an integration test,
# the 'shebang' sanity test should ignore it. This "test" is successful when no
# ignore.txt entry is needed for this file.

@ -0,0 +1,7 @@
#!/bin/foo
# Shell script with non-standard shebang.
# Since it appears in a files/ or templates/ directory inside an integration test,
# the 'shebang' sanity test should ignore it. This "test" is successful when no
# ignore.txt entry is needed for this file (inside the collection).

@ -0,0 +1,7 @@
#!/pyth
# Python file with non-standard shebang.
# Since it appears in a files/ or templates/ directory inside an integration test,
# the 'shebang' sanity test should ignore it. This "test" is successful when no
# ignore.txt entry is needed for this file.

@ -0,0 +1,7 @@
#!/bin/foo
# Shell script with non-standard shebang.
# Since it appears in a files/ or templates/ directory inside an integration test,
# the 'shebang' sanity test should ignore it. This "test" is successful when no
# ignore.txt entry is needed for this file (inside the collection).

@ -0,0 +1,7 @@
#!/pyth
# Python file with non-standard shebang.
# Since it appears in a files/ or templates/ directory inside an integration test,
# the 'shebang' sanity test should ignore it. This "test" is successful when no
# ignore.txt entry is needed for this file.

@ -0,0 +1,7 @@
#!/bin/foo
# Shell script with non-standard shebang.
# Since it appears in a files/ or templates/ directory inside an integration test,
# the 'shebang' sanity test should ignore it. This "test" is successful when no
# ignore.txt entry is needed for this file.

@ -61,6 +61,7 @@ def main():
is_module = False
is_integration = False
is_role_file = False
dirname = os.path.dirname(path)
@ -84,6 +85,10 @@ def main():
print('%s:%d:%d: should not have a shebang' % (path, 0, 0))
continue
elif re.search('^roles/[^/]+/(?:files|templates)/', path):
is_role_file = True
elif re.search('^tests/integration/targets/[^/]+/(?:files|templates)/', path):
is_role_file = True
elif path.startswith('test/integration/targets/') or path.startswith('tests/integration/targets/'):
is_integration = True
@ -111,6 +116,8 @@ def main():
print('%s:%d:%d: expected module shebang "%s" but found: %s' % (path, 1, 1, expected_shebang, shebang))
else:
print('%s:%d:%d: expected module extension %s but found: %s' % (path, 0, 0, expected_ext, ext))
elif is_role_file:
continue
else:
if is_integration:
allowed = integration_shebangs

@ -75,6 +75,15 @@ test/integration/targets/ansible-test-docker/ansible_collections/ns/col/plugins/
test/integration/targets/ansible-test-docker/ansible_collections/ns/col/tests/unit/plugins/modules/test_hello.py pylint:relative-beyond-top-level
test/integration/targets/ansible-test-docker/ansible_collections/ns/col/tests/unit/plugins/module_utils/test_my_util.py pylint:relative-beyond-top-level
test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/vendored_pty.py pep8!skip # vendored code
test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/roles/foo/files/test.py shebang
test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/roles/foo/files/test.sh shebang
test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/roles/foo/files/test.sh shellcheck:SC1008
test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/tests/integration/targets/valid/files/test.py shebang
test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/tests/integration/targets/valid/files/test.sh shebang
test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/tests/integration/targets/valid/files/test.sh shellcheck:SC1008
test/integration/targets/ansible-test-sanity-shebang/files/test.py shebang
test/integration/targets/ansible-test-sanity-shebang/files/test.sh shebang
test/integration/targets/ansible-test-sanity-shebang/files/test.sh shellcheck:SC1008
test/integration/targets/collections_relative_imports/collection_root/ansible_collections/my_ns/my_col/plugins/modules/my_module.py pylint:relative-beyond-top-level
test/integration/targets/collections_relative_imports/collection_root/ansible_collections/my_ns/my_col/plugins/module_utils/my_util2.py pylint:relative-beyond-top-level
test/integration/targets/fork_safe_stdio/vendored_pty.py pep8!skip # vendored code

Loading…
Cancel
Save