bd0fd2619c
Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2670
20 lines
544 B
Python
Executable File
20 lines
544 B
Python
Executable File
#!/usr/bin/env python3
|
|
import re
|
|
import sys
|
|
import subprocess
|
|
|
|
# Run this script through arc lint
|
|
|
|
MESSAGE = "Wrong formatting!"
|
|
|
|
data = subprocess.run(
|
|
["clang-format", "--output-replacements-xml", sys.argv[1]],
|
|
stdout=subprocess.PIPE, check=True).stdout.decode(
|
|
"utf-8").strip().split("\n")
|
|
for row in data:
|
|
match = re.match(
|
|
r"^<replacement offset='([0-9]+)' length='([0-9]+)'>", row)
|
|
if match:
|
|
offset = int(match.group(1)) + int(match.group(2))
|
|
print("warning:{}:{}".format(offset, MESSAGE))
|