How to use the autopep8.fix_multiple_files function in autopep8

To help you get started, we’ve selected a few autopep8 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 awesto / cookiecutter-django-shop / hooks / post_gen_project.py View on Github external
def reformat_white_space():
    try:
        import autopep8
    except ImportError:
        print(WARNING + "Could not find 'autopep8', exceeding whitespace will not be removed!" + TERMINATOR)
        return

    merchant_dir_path = os.path.abspath("./{{ cookiecutter.app_name }}")
    args = autopep8.parse_args(['--max-line-length 119', '--in-place', '--recursive'])
    if os.path.exists(merchant_dir_path):
        autopep8.fix_multiple_files([merchant_dir_path], args)
github openworm / open-worm-analysis-toolbox / temp_fix_pep8.py View on Github external
cur_path = path.dirname(path.realpath(__file__))
except NameError:
    # ASSUMES IN ROOT PATH - i.e. that wormpy package is in this folder
    cur_path = os.getcwd()

wormpy_path = path.join(cur_path, 'wormpy')
stats_path  = path.join(wormpy_path,'stats')

print(wormpy_path)

wormpy_files = glob.glob(path.join(wormpy_path, '*.py'))
root_files = glob.glob(path.join(cur_path, '*.py'))
stats_files = glob.glob(path.join(stats_path, '*.py'))


ap.fix_multiple_files(wormpy_files,options=options)
ap.fix_multiple_files(root_files, options=options)
ap.fix_multiple_files(stats_files, options=options)
github Shopify / shopify_python / shopify_python / git_utils.py View on Github external
experimental=False,
                              global_config=None,
                              ignore='',
                              ignore_local_config=False,
                              in_place=True,
                              indent_size=4,
                              jobs=0,
                              line_range=None,
                              list_fixes=False,
                              max_line_length=max_line_length,
                              pep8_passes=-1,
                              recursive=False,
                              select={'W', 'E'},
                              verbose=0,
                              hang_closing=False)
    autopep8.fix_multiple_files(files, options, sys.stdout)
github Azure / azure-cli-shell / linter / pep8.py View on Github external
def fix_p2p8(directory):
    import autopep8
    import multiprocessing

    # pylint: disable=protected-access
    autopep8.fix_multiple_files([directory],
                                options=autopep8._get_options(
                                    {
                                        'jobs': multiprocessing.cpu_count(),
                                        'verbose': True,
                                        'recursive': True,
                                        'in_place': True,
                                        'max_line_length': 100
                                    }, False))
github Azure / azure-cli / tools / automation / style / pep8.py View on Github external
def fix_p2p8(directory):
    import autopep8
    import multiprocessing

    # pylint: disable=protected-access
    autopep8.fix_multiple_files([directory],
                                options=autopep8._get_options(
                                    {
                                        'jobs': multiprocessing.cpu_count(),
                                        'verbose': True,
                                        'recursive': True,
                                        'in_place': True,
                                        'max_line_length': 100
                                    }, False))