Browse Source

ci(check): force check clang-format version

GitOrigin-RevId: 5080264f5f
release-1.7
Megvii Engine Team 3 years ago
parent
commit
4cb7fa8e28
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      tools/format.py

+ 15
- 0
tools/format.py View File

@@ -104,6 +104,21 @@ def main():
else:
raise ValueError("Invalid path {}".format(path))

# check version, we only support 12.0.1 now
version = subprocess.check_output(
[
args.clang_format,
"--version",
],
)
version = version.decode("utf-8")

need_version = '12.0.1'
if version.find(need_version) < 0:
print('We only support {} now, please install {} version, find version: {}'
.format(need_version, need_version, version))
raise RuntimeError('clang-format version not equal {}'.format(need_version))

process_map(
partial(process_file, clang_format=args.clang_format, write=args.write,),
files,


Loading…
Cancel
Save