cardinal_pythonlib.tools.explore_clang_format_config


Original code copyright (C) 2009-2022 Rudolf Cardinal (rudolf@pobox.com).

This file is part of cardinal_pythonlib.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Test clang-format options.

cardinal_pythonlib.tools.explore_clang_format_config.clang_format(config: str, src: str, dest: str, dir: str, clang_format_exe: str) None[source]

Rungs clang-format, formatting a source file to a destination file using a YAML config.

cardinal_pythonlib.tools.explore_clang_format_config.explore_clang_format(config_filename: str, source_filenames: List[str], clang_format_exe: str, meld_exe: str, sleep_time_s: int = 1) None[source]

Launch Meld to compare before-and-after C++ code. Watch for changes in the config file and rebuild the processed C++ if so.

cardinal_pythonlib.tools.explore_clang_format_config.main() None[source]

Command-line entry point.

cardinal_pythonlib.tools.explore_clang_format_config.monitor_diff(filenames: List[str], meld_exe: str) Popen[source]

Fire up Meld in the background for a 3-way comparison. Meld automatically offers to reload if a file is changed.