-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add clang-tidy checks for Firestore #1078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
deca43f
e6ceeac
e0bc1bb
4ba77c3
2f96992
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' | ||
... |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ class ComparatorHolder { | |
template <typename C> | ||
class ComparatorHolder<C, true> : private C { | ||
protected: | ||
explicit ComparatorHolder(const C&) noexcept { | ||
explicit ComparatorHolder(const C& /* comparator */) noexcept { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe put the parameter name outside of comment like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That causes a different warning about an unused parameter. This way both the compiler and the linter are happy. I could also do explicit ComparatorHolder(const C& comparator) noexcept {
(void)comparator;
} But considered this to be inferior. I have no strong preference though. |
||
} | ||
|
||
const C& comparator() const noexcept { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you elaborate why remove
static
here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests instantiate the serializer and then access these static methods through the instance, which causes a warning under clang-tidy.
In the fullness of time the serializer will need to be stateful (for example, to encode a DocumentKey you need to know the current DatabaseId) so fixing those warnings by removing the static seemed like the better way.