4264be2b18
* orphans testing pages to avoid not-in-toctree errors * orphans various pages pending reorg * adds module_utils and special_vars to main TOC * uses a glob for scenario_guide TOC * normalize and Sentence-case headings on community pages, typos * re-orgs community TOC, adds all pages to toctree * removes scenario guides index page * adds style guide to community index * basic update to style guide * fix typo that created a new error * removes not-in-toctree from ignore errors list * leave removing files for future cleanup task
871 B
871 B
- orphan
Sanity Tests » no-wildcard-import
Using import *
is a bad habit which pollutes your
namespace, hinders debugging, and interferes with static analysis of
code. For those reasons, we do want to limit the use of
import *
in the ansible code. Change our code to import the
specific names that you need instead.
Examples of unfixed code:
from ansible.module_utils.six import *
if isinstance(variable, string_types):
do_something(variable)
from ansible.module_utils.basic import *
= AnsibleModule() module
Examples of fixed code:
from ansible.module_utils import six
if isinstance(variable, six.string_types):
do_something(variable)
from ansible.module_utils.basic import AnsibleModule
= AnsibleModule() module