Bring back build/header_guard cpplint.

This commit is contained in:
Cheng Zhao 2014-03-16 08:58:59 +08:00
Родитель 68cb6ee861
Коммит bbef33a33a
26 изменённых файлов: 90 добавлений и 86 удалений

Просмотреть файл

@ -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 ATOM_APP_ATOM_LIBRARY_MAIN_
#define ATOM_APP_ATOM_LIBRARY_MAIN_
#ifndef ATOM_APP_ATOM_LIBRARY_MAIN_H_
#define ATOM_APP_ATOM_LIBRARY_MAIN_H_
#include "base/basictypes.h"
@ -14,4 +14,4 @@ int AtomMain(int argc, const char* argv[]);
}
#endif // OS_MACOSX
#endif // ATOM_APP_ATOM_LIBRARY_MAIN_
#endif // ATOM_APP_ATOM_LIBRARY_MAIN_H_

Просмотреть файл

@ -2,4 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ATOM_APP_ATOM_MAIN_H_
#define ATOM_APP_ATOM_MAIN_H_
#include "content/public/app/content_main.h"
#endif // ATOM_APP_ATOM_MAIN_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 ATOM_APP_ATOM_MAIN_DELEGATE_
#define ATOM_APP_ATOM_MAIN_DELEGATE_
#ifndef ATOM_APP_ATOM_MAIN_DELEGATE_H_
#define ATOM_APP_ATOM_MAIN_DELEGATE_H_
#include "brightray/common/main_delegate.h"
@ -38,4 +38,4 @@ class AtomMainDelegate : public brightray::MainDelegate {
} // namespace atom
#endif // ATOM_APP_ATOM_MAIN_DELEGATE_
#endif // ATOM_APP_ATOM_MAIN_DELEGATE_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 ATOM_BROWSER_ATOM_API_EVENT_H_
#define ATOM_BROWSER_ATOM_API_EVENT_H_
#ifndef ATOM_BROWSER_API_ATOM_API_EVENT_H_
#define ATOM_BROWSER_API_ATOM_API_EVENT_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@ -64,4 +64,4 @@ class Event : public node::ObjectWrap,
} // namespace atom
#endif // ATOM_BROWSER_ATOM_API_EVENT_H_
#endif // ATOM_BROWSER_API_ATOM_API_EVENT_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 ATOM_BROWSER_API_ATOM_BROWSER_BINDINGS_
#define ATOM_BROWSER_API_ATOM_BROWSER_BINDINGS_
#ifndef ATOM_BROWSER_API_ATOM_BROWSER_BINDINGS_H_
#define ATOM_BROWSER_API_ATOM_BROWSER_BINDINGS_H_
#include "base/strings/string16.h"
#include "atom/common/api/atom_bindings.h"
@ -46,4 +46,4 @@ class AtomBrowserBindings : public AtomBindings {
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_BINDINGS_
#endif // ATOM_BROWSER_API_ATOM_BROWSER_BINDINGS_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 ATOM_BROWSER_ATOM_BROWSER_CLIENT_
#define ATOM_BROWSER_ATOM_BROWSER_CLIENT_
#ifndef ATOM_BROWSER_ATOM_BROWSER_CLIENT_H_
#define ATOM_BROWSER_ATOM_BROWSER_CLIENT_H_
#include "brightray/browser/browser_client.h"
@ -40,4 +40,4 @@ class AtomBrowserClient : public brightray::BrowserClient {
} // namespace atom
#endif // ATOM_BROWSER_ATOM_BROWSER_CLIENT_
#endif // ATOM_BROWSER_ATOM_BROWSER_CLIENT_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 ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_
#ifndef ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
#include "brightray/browser/browser_main_parts.h"
@ -48,4 +48,4 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
} // namespace atom
#endif // ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_
#endif // ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_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 ATOM_BROSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_
#define ATOM_BROSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_
#ifndef ATOM_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_
#define ATOM_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_
#include "content/public/browser/javascript_dialog_manager.h"
@ -34,4 +34,4 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
} // namespace atom
#endif // ATOM_BROSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_H_
#endif // ATOM_BROWSER_ATOM_JAVASCRIPT_DIALOG_MANAGER_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 ATOM_BROSER_BROWSER_OBSERVER_H_
#define ATOM_BROSER_BROWSER_OBSERVER_H_
#ifndef ATOM_BROWSER_BROWSER_OBSERVER_H_
#define ATOM_BROWSER_BROWSER_OBSERVER_H_
#include <string>
@ -40,4 +40,4 @@ class BrowserObserver {
} // namespace atom
#endif // ATOM_BROSER_BROWSER_OBSERVER_H_
#endif // ATOM_BROWSER_BROWSER_OBSERVER_H_

Просмотреть файл

@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_NET_ATOM_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
#define ATOM_BROWSER_NET_ATOM_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
#ifndef ATOM_BROWSER_NET_ATOM_URL_REQUEST_JOB_FACTORY_H_
#define ATOM_BROWSER_NET_ATOM_URL_REQUEST_JOB_FACTORY_H_
#include <map>
#include <vector>
@ -59,4 +59,4 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
} // namespace atom
#endif // ATOM_BROWSER_NET_ATOM_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
#endif // ATOM_BROWSER_NET_ATOM_URL_REQUEST_JOB_FACTORY_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 BROWSER_UI_ACCELERATOR_UTIL_H_
#define BROWSER_UI_ACCELERATOR_UTIL_H_
#ifndef ATOM_BROWSER_UI_ACCELERATOR_UTIL_H_
#define ATOM_BROWSER_UI_ACCELERATOR_UTIL_H_
#include <map>
#include <string>
@ -35,4 +35,4 @@ bool TriggerAcceleratorTableCommand(AcceleratorTable* table,
} // namespace accelerator_util
#endif // BROWSER_UI_ACCELERATOR_UTIL_H_
#endif // ATOM_BROWSER_UI_ACCELERATOR_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 BROWSER_UI_FILE_DIALOG_H_
#define BROWSER_UI_FILE_DIALOG_H_
#ifndef ATOM_BROWSER_UI_FILE_DIALOG_H_
#define ATOM_BROWSER_UI_FILE_DIALOG_H_
#include <string>
#include <vector>
@ -54,4 +54,4 @@ void ShowSaveDialog(atom::NativeWindow* parent_window,
} // namespace file_dialog
#endif // BROWSER_UI_FILE_DIALOG_H_
#endif // ATOM_BROWSER_UI_FILE_DIALOG_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 BROWSER_UI_MESSAGE_BOX_H_
#define BROWSER_UI_MESSAGE_BOX_H_
#ifndef ATOM_BROWSER_UI_MESSAGE_BOX_H_
#define ATOM_BROWSER_UI_MESSAGE_BOX_H_
#include <string>
#include <vector>
@ -39,4 +39,4 @@ void ShowMessageBox(NativeWindow* parent_window,
} // namespace atom
#endif // BROWSER_UI_MESSAGE_BOX_H_
#endif // ATOM_BROWSER_UI_MESSAGE_BOX_H_

Просмотреть файл

@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BROWSER_UI_WIN_MENU_2_H_
#define BROWSER_UI_WIN_MENU_2_H_
#ifndef ATOM_BROWSER_UI_WIN_MENU_2_H_
#define ATOM_BROWSER_UI_WIN_MENU_2_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
@ -93,4 +93,4 @@ class Menu2 {
} // namespace atom
#endif // BROWSER_UI_WIN_MENU_2_H_
#endif // ATOM_BROWSER_UI_WIN_MENU_2_H_

Просмотреть файл

@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BROWSER_UI_WIN_NATIVE_MENU_WIN_H_
#define BROWSER_UI_WIN_NATIVE_MENU_WIN_H_
#ifndef ATOM_BROWSER_UI_WIN_NATIVE_MENU_WIN_H_
#define ATOM_BROWSER_UI_WIN_NATIVE_MENU_WIN_H_
#include <vector>
@ -189,4 +189,4 @@ class NativeMenuWin {
} // namespace atom
#endif // BROWSER_UI_WIN_NATIVE_MENU_WIN_H_
#endif // ATOM_BROWSER_UI_WIN_NATIVE_MENU_WIN_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 ATOM_BROSER_WINDOW_LIST_OBSERVER_H_
#define ATOM_BROSER_WINDOW_LIST_OBSERVER_H_
#ifndef ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_
#define ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_
namespace atom {
@ -27,7 +27,6 @@ class WindowListObserver {
virtual ~WindowListObserver() {}
};
} // namespace atom
#endif // ATOM_BROSER_WINDOW_LIST_OBSERVER_H_
#endif // ATOM_BROWSER_WINDOW_LIST_OBSERVER_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 ATOM_COMMON_API_ATOM_BINDINGS_
#define ATOM_COMMON_API_ATOM_BINDINGS_
#ifndef ATOM_COMMON_API_ATOM_BINDINGS_H_
#define ATOM_COMMON_API_ATOM_BINDINGS_H_
#include "base/basictypes.h"
#include "v8/include/v8.h"
@ -33,4 +33,4 @@ class AtomBindings {
} // namespace atom
#endif // ATOM_COMMON_API_ATOM_BINDINGS_
#endif // ATOM_COMMON_API_ATOM_BINDINGS_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 COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_H_
#define COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_H_
#ifndef ATOM_COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_H_
#define ATOM_COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_H_
#include <string>
@ -128,4 +128,4 @@ class CrashService {
} // namespace breakpad
#endif // COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_H_
#endif // ATOM_COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_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 COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_MAIN_H_
#define COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_MAIN_H_
#ifndef ATOM_COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_MAIN_H_
#define ATOM_COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_MAIN_H_
namespace crash_service {
@ -12,4 +12,4 @@ int Main(const wchar_t* cmd_line);
} // namespace crash_service
#endif // COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_MAIN_H_
#endif // ATOM_COMMON_CRASH_REPORTER_WIN_CRASH_SERVICE_MAIN_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 ATOM_COMMON_NODE_BINDINGS_MAC_
#define ATOM_COMMON_NODE_BINDINGS_MAC_
#ifndef ATOM_COMMON_NODE_BINDINGS_MAC_H_
#define ATOM_COMMON_NODE_BINDINGS_MAC_H_
#include "base/compiler_specific.h"
#include "atom/common/node_bindings.h"
@ -31,4 +31,4 @@ class NodeBindingsMac : public NodeBindings {
} // namespace atom
#endif // ATOM_COMMON_NODE_BINDINGS_MAC_
#endif // ATOM_COMMON_NODE_BINDINGS_MAC_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 ATOM_COMMON_NODE_BINDINGS_WIN_
#define ATOM_COMMON_NODE_BINDINGS_WIN_
#ifndef ATOM_COMMON_NODE_BINDINGS_WIN_H_
#define ATOM_COMMON_NODE_BINDINGS_WIN_H_
#include "base/compiler_specific.h"
#include "atom/common/node_bindings.h"
@ -23,4 +23,4 @@ class NodeBindingsWin : public NodeBindings {
} // namespace atom
#endif // ATOM_COMMON_NODE_BINDINGS_WIN_
#endif // ATOM_COMMON_NODE_BINDINGS_WIN_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 ATOM_COMMON_OPTIONS_SWITCHES_
#define ATOM_COMMON_OPTIONS_SWITCHES_
#ifndef ATOM_COMMON_OPTIONS_SWITCHES_H_
#define ATOM_COMMON_OPTIONS_SWITCHES_H_
namespace atom {
@ -33,4 +33,4 @@ extern const char kAcceptFirstMouse[];
} // namespace atom
#endif // ATOM_COMMON_OPTIONS_SWITCHES_
#endif // ATOM_COMMON_OPTIONS_SWITCHES_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 ATOM_COMMON_SCOPED_PERSISTENT_H_
#define ATOM_COMMON_SCOPED_PERSISTENT_H_
#ifndef ATOM_COMMON_V8_SCOPED_PERSISTENT_H_
#define ATOM_COMMON_V8_SCOPED_PERSISTENT_H_
#include "base/logging.h"
#include "base/memory/ref_counted.h"
@ -112,4 +112,4 @@ typedef scoped_refptr<RefCountedPersistent<v8::Object>> RefCountedV8Object;
} // namespace atom
#endif // ATOM_COMMON_SCOPED_PERSISTENT_H_
#endif // ATOM_COMMON_V8_SCOPED_PERSISTENT_H_

Просмотреть файл

@ -42,4 +42,4 @@ class AtomRendererBindings : public AtomBindings {
} // namespace atom
#endif // ATOM_RENDERER_API_ATOM_BINDINGS_H_
#endif // ATOM_RENDERER_API_ATOM_RENDERER_BINDINGS_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 ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_
#define ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_
#ifndef ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_H_
#define ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_H_
#include "content/public/renderer/render_view_observer.h"
@ -39,4 +39,4 @@ class AtomRenderViewObserver : public content::RenderViewObserver {
} // namespace atom
#endif // ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_
#endif // ATOM_RENDERER_ATOM_RENDER_VIEW_OBSERVER_H_

30
script/cpplint.py поставляемый
Просмотреть файл

@ -7,19 +7,19 @@ import sys
from lib.util import execute
IGNORE_FILES = [
os.path.join('browser', 'atom_application_mac.h'),
os.path.join('browser', 'atom_application_delegate_mac.h'),
os.path.join('browser', 'native_window_mac.h'),
os.path.join('browser', 'resources', 'win', 'resource.h'),
os.path.join('browser', 'ui', 'cocoa', 'event_processing_window.h'),
os.path.join('browser', 'ui', 'cocoa', 'atom_menu_controller.h'),
os.path.join('browser', 'ui', 'cocoa', 'nsalert_synchronous_sheet.h'),
os.path.join('browser', 'ui', 'gtk', 'gtk_custom_menu.cc'),
os.path.join('browser', 'ui', 'gtk', 'gtk_custom_menu_item.cc'),
os.path.join('common', 'api', 'api_messages.cc'),
os.path.join('common', 'api', 'api_messages.h'),
os.path.join('common', 'atom_version.h'),
os.path.join('common', 'swap_or_assign.h'),
os.path.join('atom', 'browser', 'atom_application_mac.h'),
os.path.join('atom', 'browser', 'atom_application_delegate_mac.h'),
os.path.join('atom', 'browser', 'native_window_mac.h'),
os.path.join('atom', 'browser', 'resources', 'win', 'resource.h'),
os.path.join('atom', 'browser', 'ui', 'cocoa', 'event_processing_window.h'),
os.path.join('atom', 'browser', 'ui', 'cocoa', 'atom_menu_controller.h'),
os.path.join('atom', 'browser', 'ui', 'gtk', 'gtk_custom_menu.cc'),
os.path.join('atom', 'browser', 'ui', 'gtk', 'gtk_custom_menu_item.cc'),
os.path.join('atom', 'common', 'api', 'api_messages.cc'),
os.path.join('atom', 'common', 'api', 'api_messages.h'),
os.path.join('atom', 'common', 'api', 'atom_extensions.h'),
os.path.join('atom', 'common', 'atom_version.h'),
os.path.join('atom', 'common', 'swap_or_assign.h'),
]
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
@ -35,7 +35,7 @@ def main():
def list_files(directories, filters):
matches = []
for directory in directories:
for root, _, filenames, in os.walk(directory):
for root, _, filenames, in os.walk(os.path.join('atom', directory)):
for f in filters:
for filename in fnmatch.filter(filenames, f):
matches.append(os.path.join(root, filename))
@ -44,7 +44,7 @@ def list_files(directories, filters):
def call_cpplint(files):
cpplint = os.path.join(SOURCE_ROOT, 'vendor', 'depot_tools', 'cpplint.py')
rules = '--filter=-build/header_guard,-build/include_what_you_use'
rules = '--filter=-build/include_what_you_use'
execute([sys.executable, cpplint, rules] + files)