(against, apply=False)
| 62 | |
| 63 | |
| 64 | def yapf_format(against, apply=False): |
| 65 | if not shutil.which('yapf'): |
| 66 | print("yapf not installed. Skipping format.") |
| 67 | return |
| 68 | diff_flag = "--in-place" if apply else "--diff" |
| 69 | files = ' '.join(get_changed_files(against)) |
| 70 | files = [ |
| 71 | f for f in files if f.endswith(YAPF_EXTENSIONS) and not is_excluded(f) |
| 72 | ] |
| 73 | if files: |
| 74 | run(f"yapf {diff_flag} -p {files}", cwd=get_top(), verbose=True) |
| 75 | else: |
| 76 | print("No modified python files to format") |
| 77 | |
| 78 | |
| 79 | def main(): |
no test coverage detected