Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for imports to be between last doc line and first callable #21863

Merged
merged 2 commits into from
Feb 24, 2017

Conversation

sivel
Copy link
Member

@sivel sivel commented Feb 23, 2017

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

validate-modules

ANSIBLE VERSION
devel
SUMMARY

This change checks whether imports are between the last doc line and the first callable.

This will cause an error for imports at the bottom for new modules. Displays a warning for legacy modules.

Example output:

./test/sanity/validate-modules/validate-modules lib/ansible/modules/cloud/rackspace/rax.py -w
============================================================================
lib/ansible/modules/cloud/rackspace/rax.py
============================================================================
WARNING:312:No RETURN provided
WARNING:208:module_utils imports should import specific components, not "*". line 893
WARNING:208:module_utils imports should import specific components, not "*". line 894
WARNING:107:Imports should be directly below DOCUMENTATION/EXAMPLES/RETURN/ANSIBLE_METADATA. line 893
WARNING:107:Imports should be directly below DOCUMENTATION/EXAMPLES/RETURN/ANSIBLE_METADATA. line 894

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 feature_pull_request needs_triage Needs a first human triage before being processed. labels Feb 23, 2017
@sivel
Copy link
Member Author

sivel commented Feb 23, 2017

/cc @mattclay @gundalow

@gundalow gundalow removed the needs_triage Needs a first human triage before being processed. label Feb 23, 2017
@sivel sivel merged commit 97e12b0 into ansible:devel Feb 24, 2017
@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_pull_request labels Mar 4, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 feature This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants