1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 19:02:18 +01:00

Use Clang 11 (#1846)

This commit is contained in:
Stefan Agner
2021-06-08 22:16:17 +02:00
committed by GitHub
parent 4711f36a1f
commit 13fe9e83fa
7 changed files with 74 additions and 32 deletions

View File

@@ -31,7 +31,7 @@ def run_format(args, queue, lock):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
path = queue.get()
invocation = ['clang-format-7']
invocation = ['clang-format-11']
if args.inplace:
invocation.append('-i')
invocation.append(path)
@@ -69,12 +69,12 @@ def main():
args = parser.parse_args()
try:
get_output('clang-format-7', '-version')
get_output('clang-format-11', '-version')
except:
print("""
Oops. It looks like clang-format is not installed.
Please check you can run "clang-format-7 -version" in your terminal and install
Please check you can run "clang-format-11 -version" in your terminal and install
clang-format (v7) if necessary.
Note you can also upload your code as a pull request on GitHub and see the CI check

View File

@@ -30,7 +30,7 @@ else:
def run_tidy(args, tmpdir, queue, lock, failed_files):
while True:
path = queue.get()
invocation = ['clang-tidy-7', '-header-filter=^{}/.*'.format(re.escape(basepath))]
invocation = ['clang-tidy-11', '-header-filter=^{}/.*'.format(re.escape(basepath))]
if tmpdir is not None:
invocation.append('-export-fixes')
# Get a temporary file. We immediately close the handle so clang-tidy can
@@ -90,13 +90,13 @@ def main():
args = parser.parse_args()
try:
get_output('clang-tidy-7', '-version')
get_output('clang-tidy-11', '-version')
except:
print("""
Oops. It looks like clang-tidy is not installed.
Oops. It looks like clang-tidy-11 is not installed.
Please check you can run "clang-tidy-7 -version" in your terminal and install
clang-tidy (v7) if necessary.
Please check you can run "clang-tidy-11 -version" in your terminal and install
clang-tidy (v11) if necessary.
Note you can also upload your code as a pull request on GitHub and see the CI check
output to apply clang-tidy.
@@ -163,7 +163,7 @@ def main():
if args.fix and failed_files:
print('Applying fixes ...')
try:
subprocess.call(['clang-apply-replacements-7', tmpdir])
subprocess.call(['clang-apply-replacements-11', tmpdir])
except:
print('Error applying fixes.\n', file=sys.stderr)
raise