Use clang-tidy 7

pull/24205/head
Esun Kim 5 years ago
parent 09ace01cc1
commit b8f1b71a05
  1. 17
      .clang-tidy
  2. 9
      templates/tools/dockerfile/grpc_clang_tidy/Dockerfile.template
  3. 13
      templates/tools/dockerfile/test/sanity/Dockerfile.template
  4. 7
      tools/distrib/run_clang_tidy.py
  5. 9
      tools/dockerfile/grpc_clang_tidy/Dockerfile
  6. 13
      tools/dockerfile/test/sanity/Dockerfile

@ -1,6 +1,19 @@
---
Checks: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size,performance-*,bugprone-*'
WarningsAsErrors: 'modernize-use-nullptr,google-build-namespaces,google-build-explicit-make-pair,readability-function-size,performance-*,bugprone-*'
Checks: '-*,
bugprone-*,
-bugprone-forward-declaration-namespace,
-bugprone-integer-division,
-bugprone-misplaced-widening-cast,
-bugprone-narrowing-conversions,
-bugprone-too-small-loop-variable,
performance-*,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
google-build-namespaces,
google-build-explicit-make-pair,
modernize-use-nullptr,
readability-function-size'
WarningsAsErrors: '*'
CheckOptions:
- key: readability-function-size.StatementThreshold
value: '450'

@ -16,12 +16,9 @@
<%include file="../python_debian10.include"/>
# Install clang-tidy 6.0
# This is because clang-tidy 7.0 started treating compiler errors as tidy errors
# and there are a couple of files which are not properly compiled via tidy so it
# should be using 6.0 version until all compilation errors are addressed.
RUN apt-get update && apt-get install -y clang-tidy-6.0 jq
ENV CLANG_TIDY=clang-tidy-6.0
# Install clang-tidy 7
RUN apt-get update && apt-get install -y clang-tidy-7 jq
ENV CLANG_TIDY=clang-tidy-7
ADD clang_tidy_all_the_things.sh /

@ -33,15 +33,10 @@
RUN python2 -m pip install simplejson mako virtualenv==16.7.9 lxml
RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml
# Install clang & clang-format
RUN apt-get install -y clang clang-format
# Install clang-tidy 6.0
# This is because clang-tidy 7.0 started treating compiler errors as tidy errors
# and there are a couple of files which are not properly compiled via tidy so it
# should be using 6.0 version until all compilation errors are addressed.
RUN apt-get install -y clang-tidy-6.0 jq
ENV CLANG_TIDY=clang-tidy-6.0
# Install clang, clang-format, and clang-tidy
RUN apt-get install -y clang clang-format-7 clang-tidy-7 jq
ENV CLANG_FORMAT=clang-format-7
ENV CLANG_TIDY=clang-tidy-7
<%include file="../../bazel.include"/>

@ -37,8 +37,15 @@ argp.add_argument('-j',
argp.set_defaults(fix=False)
args = argp.parse_args()
# Explicitly passing the .clang-tidy config by reading it.
# This is required because source files in the compilation database are
# in a different source tree so clang-tidy cannot find the right config file
# by seeking their parent directories.
with open(".clang-tidy") as f:
config = f.read()
cmdline = [
clang_tidy,
'--config=' + config,
]
if args.fix:

@ -61,12 +61,9 @@ RUN mkdir /var/local/jenkins
# Install clang-tidy 6.0
# This is because clang-tidy 7.0 started treating compiler errors as tidy errors
# and there are a couple of files which are not properly compiled via tidy so it
# should be using 6.0 version until all compilation errors are addressed.
RUN apt-get update && apt-get install -y clang-tidy-6.0 jq
ENV CLANG_TIDY=clang-tidy-6.0
# Install clang-tidy 7
RUN apt-get update && apt-get install -y clang-tidy-7 jq
ENV CLANG_TIDY=clang-tidy-7
ADD clang_tidy_all_the_things.sh /

@ -81,15 +81,10 @@ RUN apt-get update && apt-get install -y \
RUN python2 -m pip install simplejson mako virtualenv==16.7.9 lxml
RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml
# Install clang & clang-format
RUN apt-get install -y clang clang-format
# Install clang-tidy 6.0
# This is because clang-tidy 7.0 started treating compiler errors as tidy errors
# and there are a couple of files which are not properly compiled via tidy so it
# should be using 6.0 version until all compilation errors are addressed.
RUN apt-get install -y clang-tidy-6.0 jq
ENV CLANG_TIDY=clang-tidy-6.0
# Install clang, clang-format, and clang-tidy
RUN apt-get install -y clang clang-format-7 clang-tidy-7 jq
ENV CLANG_FORMAT=clang-format-7
ENV CLANG_TIDY=clang-tidy-7
#========================

Loading…
Cancel
Save