-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored clang version check into a python script. (#1471)
* Refactored check-check-clang-format-version to a python script to fix crashes on win32. * Lint * Changed exit codes to ValueError exception. * Split subprocess arguments string. * Explicitly call python3. * Changed string split to use default whitespace separators.
- Loading branch information
Showing
3 changed files
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import subprocess | ||
|
||
EXPECTED_CLANG_VERSION = "18.1.6" | ||
|
||
|
||
def main(): | ||
result = subprocess.run(("clang-format", "--version"), capture_output=True) | ||
result.check_returncode() | ||
|
||
version_str = result.stdout.decode("utf-8").split()[2].strip() | ||
if version_str != EXPECTED_CLANG_VERSION: | ||
raise ValueError( | ||
f"Error: Found clang-format version {version_str}, but {EXPECTED_CLANG_VERSION} is required." | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file was deleted.
Oops, something went wrong.