Commit graph

11 commits

Author SHA1 Message Date
Adrien Vergé
527d8307c1 Lint YAML files under test/
This commit extends YAML linting by enabling standard rules from the
`yamllint` tool [1]. Since syntax errors and key duplicates are already
checked since 4d48711, this change only adds detection for cosmetic
problems. It also narrows checks to the test/ dir only.

The main goal is to prevent future problems to enter the code base
without being noticed. While it would be a huge effort to be PEP8
compliant, it is relatively easy to have correct YAML style *now* and
prevent future errors by enabling linting.

Note: for those (like me) caring about code attribution: use `git blame
-w` to ignore whitespace-only changes.

Note: I disabled some linting checks (such as indentation), they can be
enforced in the future if needed. Similarly, current checks can also be
disabled. See the `.yamllint` file.

[1]: https://yamllint.readthedocs.io/
2016-11-11 14:50:57 -08:00
Matt Clay
912d6ed8cc Clean up code-smell sanity scripts. (#18407)
- Replace find ';' with '+' for faster execution.
- Replace grep -R with -r to avoid recursive warnings.
- Exclude .git and .tox directories from recursive grep.
- Improve messaging on failed sanity checks.
- Add no-basestring check to Shippable.
2016-11-07 16:46:33 -08:00
Matt Clay
8c270ac75f Add empty-init code-smell script. (#18406)
Also removed boilerplate from otherwise empty __init__.py files
which should not contain any code (checked by empty-init script).
2016-11-07 15:02:13 -08:00
Matt Clay
469c4a106b Fix and create code-smell test for line endings. 2016-11-03 14:58:11 -07:00
Matt Clay
0d46805979 Clean up shebangs for various files.
- Remove shebangs from:
  - ini files
  - unit tests
  - module_utils
  - plugins
  - module_docs_fragments
  - non-executable Makefiles
- Change non-modules from '/usr/bin/python' to '/usr/bin/env python'.
- Change '/bin/env' to '/usr/bin/env'.

Also removed main functions from unit tests (since they no longer
have a shebang) and fixed a python 3 compatibility issue with
update_bundled.py so it does not need to specify a python 2 shebang.

A script was added to check for unexpected shebangs in files.
This script is run during CI on Shippable.
2016-11-02 17:00:27 -07:00
Matt Clay
71819c0a60 Test reorganization and cleanup. (#18270)
- Correct directory name in test/README.md
- Move code-smell tests to test/sanity/code-smell
- Update code-smell.sh to use new script paths
- Add test/integration/target-prefixes.win for ansible-test
- Move module unit tests to match module directory layout
2016-10-31 12:53:11 -07:00
Matt Clay
80a5c70ad7 Split integration tests out from Makefile. (#17976) 2016-10-12 14:57:53 -07:00
Matt Clay
40ffd8269d Add shellcheck to code-smell checks. (#17715) 2016-09-22 16:12:10 -07:00
Matt Clay
81a49912b0 Pin yamllint to 1.2.2 to avoid issues in 1.3.0. (#16464)
This also moves shippable test requirements to external files.
2016-06-27 16:34:19 -07:00
Adrien Vergé
4d48711242 Fix YAML source and check it on Shippable (#15678)
Fix YAML source and check it on Shippable
2016-06-04 10:58:17 -07:00
Matt Clay
b0e1efbd62 Add full support for Shippable CI. 2016-06-01 22:33:38 -07:00