diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-12 13:09:09 +0500 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-12 13:09:09 +0500 |
| commit | 59e69c1d68f6e1c92e3ea34433ceeb1a2c83b94d (patch) | |
| tree | d4b5be7d175a95017efbfe449adad37c32289b35 /project/format.py | |
| parent | README: update (diff) | |
| download | cmake-common-59e69c1d68f6e1c92e3ea34433ceeb1a2c83b94d.tar.gz cmake-common-59e69c1d68f6e1c92e3ea34433ceeb1a2c83b94d.zip | |
use contextlib.chdir
Diffstat (limited to 'project/format.py')
| -rw-r--r-- | project/format.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/project/format.py b/project/format.py index fc5ae0e..9ea3936 100644 --- a/project/format.py +++ b/project/format.py @@ -11,6 +11,7 @@ formatting the files in-place. """ import argparse +from contextlib import chdir import difflib import os import sys @@ -130,7 +131,7 @@ def do_format( version=DEFAULT_VERSION, style=DEFAULT_STYLE, in_place=False, exclude=None ): clang_format = ClangFormat(version, style) - with utils.cd(git_root_dir()): + with chdir(git_root_dir()): cpp_files = filter_files(list_cpp_files(), exclude) if in_place: clang_format.format_in_place(cpp_files) |
