From 8876622b6fcebc21672bc263666b858b7e152b45 Mon Sep 17 00:00:00 2001 From: Gil Date: Thu, 12 Apr 2018 14:54:53 -0700 Subject: Add clang-tidy checks for Firestore (#1078) * Add a .clang-tidy configuration for Firestore C++ * Fix clang-tidy warnings * typedef -> using * const ref + rvalue ref -> pass by value * NULL -> nullptr * remove useless default initializations * remove useless const value-type parameter declarations (definitions can still use them) * use auto instead of repeating types in a cast * Fix typos * Address use of static method through instance warnings * Address use after move warnings --- Firestore/core/.clang-tidy | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Firestore/core/.clang-tidy (limited to 'Firestore/core/.clang-tidy') diff --git a/Firestore/core/.clang-tidy b/Firestore/core/.clang-tidy new file mode 100644 index 0000000..a071105 --- /dev/null +++ b/Firestore/core/.clang-tidy @@ -0,0 +1,34 @@ +--- +# cert-* +# -cert-dcl50-cpp +# We use variadic functions +# -cert-err58-cpp +# GoogleTest creates instances in static scope in a way that trips this +# warning for every test. +# readability-* +# -readability-else-after-return +# -readability-implicit-bool-conversion +# These checks generate a bunch of noise that we're just not religious +# about. +# modernize-* +# -modernize-use-equals-default +# VS 2015 and Xcode <= 8.2 don't fully support this so we don't use +# `= default`. +# -modernize-use-equals-delete +# GoogleTest generates test classes that use the old idiom of making +# default constructors and operator= private. +Checks: 'bugprone-*,cert-*,-cert-dcl50-cpp,-cert-err58-cpp,google-*,objc-*,readability-*,-readability-else-after-return,-readability-implicit-bool-conversion,misc-*,modernize-*,-modernize-use-equals-default,-modernize-use-equals-delete,clang-diagnostic-*,clang-analyzer-*' +WarningsAsErrors: '' +HeaderFilterRegex: '' +CheckOptions: + - key: readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' +... -- cgit v1.2.3