You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/sanity/validate-modules
John Barker 25286c3c7d README.rst to reference new name 8 years ago
..
README.rst README.rst to reference new name 8 years ago
__init__.py Port sivel/ansible-validate-modules into Ansible 8 years ago
module_args.py Port sivel/ansible-validate-modules into Ansible 8 years ago
schema.py Port sivel/ansible-validate-modules into Ansible 8 years ago
utils.py Port sivel/ansible-validate-modules into Ansible 8 years ago
validate-modules Port sivel/ansible-validate-modules into Ansible 8 years ago

README.rst

validate-modules
===============

Python program to help test or validate Ansible modules.


Originally developed by Matt Martz (@sivel)

Usage
~~~~~

::
    # If you are running Ansible from source
    source /path/to/ansible/hacking/env-setup

    validate-modules /path/to/ansible-modules-extras

Help
~~~~

::

    usage: validate-modules [-h] [-w] [--exclude EXCLUDE] modules

    positional arguments:
      modules            Path to module or module directory

    optional arguments:
      -h, --help         show this help message and exit
      -w, --warnings     Show warnings
      --exclude EXCLUDE  RegEx exclusion pattern

Current Validations
-------------------

Modules
~~~~~~~

Errors
^^^^^^

#. Interpreter line is not ``#!/usr/bin/python``
#. ``main()`` not at the bottom of the file
#. Module does not import ``ansible.module_utils.basic``
#. Missing ``DOCUMENTATION``
#. Documentation is invalid YAML
#. Invalid schema for ``DOCUMENTATION``
#. Missing ``EXAMPLES``
#. Invalid Python Syntax
#. Tabbed indentation
#. Use of ``sys.exit()`` instead of ``exit_json`` or ``fail_json``
#. Missing GPLv3 license header in module
#. Powershell module missing ``WANT_JSON``
#. Powershell module missing ``POWERSHELL_COMMON``
#. New modules have the correct ``version_added``
#. New arguments have the correct ``version_added``
#. Modules should not import requests, instead use ``ansible.module_utils.urls``
#. Missing ``RETURN`` for new modules

Warnings
^^^^^^^^

#. Try/Except ``HAS_`` expression missing
#. Missing ``RETURN`` for existing modules
#. ``import json`` found
#. Module contains duplicate globals from basic.py

Module Directories (Python Packages)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#. Missing ``__init__.py``