summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapp/PRESUBMIT.py25
-rw-r--r--app/clipboard/scoped_clipboard_writer.h2
-rw-r--r--app/gfx/codec/jpeg_codec.cc4
-rw-r--r--app/gfx/gdi_util.h2
-rw-r--r--app/gfx/gtk_util.h6
-rw-r--r--app/l10n_util.h8
-rw-r--r--app/sql/statement.h2
-rw-r--r--app/sql/transaction.h2
-rw-r--r--app/tree_model.h2
-rw-r--r--app/tree_node_model.h2
-rw-r--r--app/win_util.h2
11 files changed, 41 insertions, 16 deletions
diff --git a/app/PRESUBMIT.py b/app/PRESUBMIT.py
new file mode 100755
index 0000000..b15b852b6
--- /dev/null
+++ b/app/PRESUBMIT.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Makes sure that the app/ code is cpplint clean."""
+
+INCLUDE_CPP_FILES_ONLY = (
+ r'.*\.cc$', r'.*\.h$'
+)
+
+EXCLUDE = (
+ # Autogenerated window resources files are off limits
+ r'.*resource.h$',
+)
+
+def CheckChangeOnUpload(input_api, output_api):
+ results = []
+ black_list = input_api.DEFAULT_BLACK_LIST + EXCLUDE
+ sources = lambda x: input_api.FilterSourceFile(
+ x, white_list=INCLUDE_CPP_FILES_ONLY, black_list=black_list)
+ results.extend(input_api.canned_checks.CheckChangeLintsClean(
+ input_api, output_api, sources))
+ return results
diff --git a/app/clipboard/scoped_clipboard_writer.h b/app/clipboard/scoped_clipboard_writer.h
index 2dc30ea..aa918a2 100644
--- a/app/clipboard/scoped_clipboard_writer.h
+++ b/app/clipboard/scoped_clipboard_writer.h
@@ -27,7 +27,7 @@ class Pickle;
class ScopedClipboardWriter {
public:
// Create an instance that is a simple wrapper around clipboard.
- ScopedClipboardWriter(Clipboard* clipboard);
+ explicit ScopedClipboardWriter(Clipboard* clipboard);
~ScopedClipboardWriter();
diff --git a/app/gfx/codec/jpeg_codec.cc b/app/gfx/codec/jpeg_codec.cc
index 75ae384..49a72ca 100644
--- a/app/gfx/codec/jpeg_codec.cc
+++ b/app/gfx/codec/jpeg_codec.cc
@@ -47,10 +47,10 @@ void ErrorExit(jpeg_common_struct* cinfo) {
namespace {
// Initial size for the output buffer in the JpegEncoderState below.
-const static int initial_output_buffer_size = 8192;
+static const int initial_output_buffer_size = 8192;
struct JpegEncoderState {
- JpegEncoderState(std::vector<unsigned char>* o)
+ explicit JpegEncoderState(std::vector<unsigned char>* o)
: out(o),
image_buffer_used(0) {
}
diff --git a/app/gfx/gdi_util.h b/app/gfx/gdi_util.h
index c458d9f..f2f9210 100644
--- a/app/gfx/gdi_util.h
+++ b/app/gfx/gdi_util.h
@@ -33,4 +33,4 @@ void SubtractRectanglesFromRegion(HRGN hrgn,
} // namespace gfx
-#endif // APP_GFX_GDI_UTIL_H_
+#endif // APP_GFX_GDI_UTIL_H_
diff --git a/app/gfx/gtk_util.h b/app/gfx/gtk_util.h
index 523f7bf..b33f0e7 100644
--- a/app/gfx/gtk_util.h
+++ b/app/gfx/gtk_util.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_GFX_GTK_UTIL_H_
-#define BASE_GFX_GTK_UTIL_H_
+#ifndef APP_GFX_GTK_UTIL_H_
+#define APP_GFX_GTK_UTIL_H_
#include <stdint.h>
#include <vector>
@@ -64,4 +64,4 @@ struct ScopedGObject {
typedef scoped_ptr_malloc<T, GObjectUnrefer<T> > Type;
};
-#endif // BASE_GFX_GTK_UTIL_H_
+#endif // APP_GFX_GTK_UTIL_H_
diff --git a/app/l10n_util.h b/app/l10n_util.h
index be15a4e..4675156 100644
--- a/app/l10n_util.h
+++ b/app/l10n_util.h
@@ -277,10 +277,10 @@ UCollationResult CompareStringWithCollator(const icu::Collator* collator,
// Used by SortStringsUsingMethod. Invokes a method on the objects passed to
// operator (), comparing the string results using a collator.
template <class T, class Method>
-class StringMethodComparatorWithCollator :
- public std::binary_function<const std::wstring&,
- const std::wstring&,
- bool> {
+class StringMethodComparatorWithCollator
+ : public std::binary_function<const std::wstring&,
+ const std::wstring&,
+ bool> {
public:
StringMethodComparatorWithCollator(icu::Collator* collator, Method method)
: collator_(collator),
diff --git a/app/sql/statement.h b/app/sql/statement.h
index 8ee6ef5..92495c7 100644
--- a/app/sql/statement.h
+++ b/app/sql/statement.h
@@ -42,7 +42,7 @@ class Statement {
// you initialize it via Assign.
Statement();
- Statement(scoped_refptr<Connection::StatementRef> ref);
+ explicit Statement(scoped_refptr<Connection::StatementRef> ref);
~Statement();
// Initializes this object with the given statement, which may or may not
diff --git a/app/sql/transaction.h b/app/sql/transaction.h
index 1e00c6f..70741d1 100644
--- a/app/sql/transaction.h
+++ b/app/sql/transaction.h
@@ -17,7 +17,7 @@ class Transaction {
// transaction. If you have begun a transaction and not committed it, the
// constructor will roll back the transaction. If you want to commit, you
// need to manually call Commit before this goes out of scope.
- Transaction(Connection* connection);
+ explicit Transaction(Connection* connection);
~Transaction();
// Returns true when there is a transaction that has been successfully begun.
diff --git a/app/tree_model.h b/app/tree_model.h
index e82aa38..882c82f 100644
--- a/app/tree_model.h
+++ b/app/tree_model.h
@@ -88,4 +88,4 @@ class TreeModel {
virtual int GetIconIndex(TreeModelNode* node) { return -1; }
};
-#endif // APP_TREE_TREE_MODEL_H_
+#endif // APP_TREE_MODEL_H_
diff --git a/app/tree_node_model.h b/app/tree_node_model.h
index 74aaed0..04aa997 100644
--- a/app/tree_node_model.h
+++ b/app/tree_node_model.h
@@ -191,7 +191,7 @@ class TreeNodeWithValue : public TreeNode< TreeNodeWithValue<ValueType> > {
public:
TreeNodeWithValue() { }
- TreeNodeWithValue(const ValueType& value)
+ explicit TreeNodeWithValue(const ValueType& value)
: ParentType(std::wstring()), value(value) { }
TreeNodeWithValue(const std::wstring& title, const ValueType& value)
diff --git a/app/win_util.h b/app/win_util.h
index 3140fbe..27a3358 100644
--- a/app/win_util.h
+++ b/app/win_util.h
@@ -42,7 +42,7 @@ class CoMemReleaser {
CoTaskMemFree(mem_ptr_);
}
- T** operator&() {
+ T** operator&() { // NOLINT
return &mem_ptr_;
}