Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def check_docstrings():
all_errors = []
docstrings = core_module_docstrings()
for module_name in sorted(docstrings.keys()):
errors = []
if module_name in IGNORE_MODULE:
continue
path = os.path.join(MODULE_PATH, "%s.py" % module_name)
mod_config = get_module_attributes(path)
params, obsolete = docstring_params(docstrings[module_name])
if list(params.keys()) != list(sorted(params.keys())):
keys = list(params.keys())
msg = "config params not in alphabetical order should be\n{keys}"
errors.append(msg.format(keys=_gen_diff(keys, sorted(keys))))
if list(obsolete.keys()) != list(sorted(obsolete.keys())):
keys = list(obsolete.keys())
def create_module_docs():
"""
Create documentation for modules.
"""
data = core_module_docstrings(format="rst")
# get screenshot data
screenshots_data = {}
samples = get_samples()
for sample in samples.keys():
module = sample.split("-")[0]
if module not in screenshots_data:
screenshots_data[module] = []
screenshots_data[module].append(sample)
out = []
# details
for module in sorted(data.keys()):
out.append("\n.. _module_%s:\n" % module) # reference for linking
out.append(
"\n{name}\n{underline}\n\n{screenshots}{details}\n".format(
name=module,