Skip to content
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

Fix C++ lint errors #668

Merged
merged 2 commits into from
Jan 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Firestore/core/src/firebase/firestore/util/assert_stdio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
* limitations under the License.
*/

#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h"

#include <stdarg.h>

#include <exception>
#include <string>

#include <absl/base/config.h>

#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h"
#include "Firestore/core/src/firebase/firestore/util/string_printf.h"
#include "absl/base/config.h"

namespace firebase {
namespace firestore {
Expand Down
4 changes: 2 additions & 2 deletions Firestore/core/src/firebase/firestore/util/string_printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <string>

#include <absl/base/attributes.h>
#include "absl/base/attributes.h"

namespace firebase {
namespace firestore {
Expand All @@ -44,4 +44,4 @@ void StringAppendV(std::string* dst, const char* format, va_list ap);
} // namespace firestore
} // namespace firebase

#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_FORMAT_H_
#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_PRINTF_H_
3 changes: 1 addition & 2 deletions Firestore/core/test/firebase/firestore/util/assert_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
* limitations under the License.
*/

#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h"

#include <exception>

#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h"
#include "gtest/gtest.h"

namespace firebase {
Expand Down
11 changes: 7 additions & 4 deletions scripts/style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ fi
if [[ $# -gt 0 && "$1" = "test-only" ]]; then
test_only=true
options="-output-replacements-xml"
shift
else
test_only=false
options="-i"
fi

(
if [[ "$test_only" = false && $# -gt 0 ]]; then
if [[ $# -gt 0 ]]; then
if git rev-parse "$1" -- >& /dev/null; then
# Argument was a branch name show files changed since that branch
git diff --name-only --relative "$1"
git diff --name-only --relative --diff-filter=ACMR "$1"
else
# Otherwise assume the passed things are files or directories
find "$@" -type f
Expand Down Expand Up @@ -68,9 +69,11 @@ fi

# Format C-ish sources only
\%\.(h|m|mm|cc)$% p
' | xargs clang-format -style=file $options | grep "<replacement " > /dev/null
' | xargs clang-format -style=file $options \
| grep "<replacement " > /dev/null

if [[ "$test_only" = true && $? -ne 1 ]]; then
echo "Proposed commit is not style compliant. Run scripts/style.sh and git add the result."
echo "Proposed commit is not style compliant."
echo "Run scripts/style.sh and git add the result."
exit 1
fi