Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make method for getting the executable public #114

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 11, 2024

  1. Make method for getting the executable public

    This is useful if one wants to call the executable in Python
    
    For instance I use this to format my code like so:
    
        def check_call_clang_format(cmd: str) -> None:
            clang_format_exe = clang_format.get_executable("clang-format")
            clang_format_sw_styles_path = importlib.resources.files("mylib.utils").joinpath(".clang-format")
            clang_format_cmd = [
                clang_format_exe,
                f"--style=file:{clang_format_sw_styles_path}",
                cmd,
            ]
            subprocess.check_call(
                " ".join(clang_format_cmd),
                shell=True,
            )
    Lauszus committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    e0f4b94 View commit details
    Browse the repository at this point in the history