How to use the pydocstyle.cli.ReturnCode function in pydocstyle

To help you get started, we’ve selected a few pydocstyle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dickreuter / neuron_poker / tests / test_pylint.py View on Github external
errors = []
    changed_files = get_relevant_files()

    if not changed_files:
        return []

    all_files = conf.get_files_to_check()
    all_files = [file for file in all_files if file[0] in changed_files]
    try:
        for filename, checked_codes, ignore_decorators in all_files:
            errors.extend(check((filename,), select=checked_codes, ignore_decorators=ignore_decorators))
    except IllegalConfiguration as error:
        # An illegal configuration file was found during file generation.
        log.error(error.args[0])
        return ReturnCode.invalid_options

    count = 0
    errors_final = []
    for err in errors:
        if hasattr(err, 'code') and not any(ignore in str(err) for ignore in IGNORES):
            sys.stdout.write('%s\n' % err)
            errors_final.append(err)
        count += 1
    return errors_final
github dickreuter / neuron_poker / tests / test_pylint.py View on Github external
def run_pydocstyle():
    """Adjust version of pydocstile to return detailed errors to the test."""
    log.setLevel(logging.DEBUG)
    conf = ConfigurationParser()
    setup_stream_handlers(conf.get_default_run_configuration())

    try:
        conf.parse()
    except IllegalConfiguration:
        return ReturnCode.invalid_options

    run_conf = conf.get_user_run_configuration()

    # Reset the logger according to the command line arguments
    setup_stream_handlers(run_conf)

    log.debug("starting in debug mode.")

    Error.explain = run_conf.explain
    Error.source = run_conf.source

    errors = []
    changed_files = get_relevant_files()

    if not changed_files:
        return []