0

remove NOLINT comments for include order

This is follow up CL for https://crrev.com/c/5367127.

Made by
```
git grep -l '#include.*NOLINT' | \
    grep -v "third_party/[^b]" | \
    xargs sed -i "s/\(#include.*\)\/\/.*NOLINT.*/\1/g"
git cl format
```
with some manual modifications.

Bug: 329138753
Change-Id: I875aa4960de3fb8a140442761e4c8046d36d5153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5432839
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288731}
This commit is contained in:
Takuto Ikuta
2024-04-17 15:37:04 +00:00
committed by Chromium LUCI CQ
parent 37fba5aa91
commit d0bcf212a4
51 changed files with 113 additions and 94 deletions

@ -28,7 +28,7 @@ IncludeCategories:
# LINT.IfChange(winheader)
- Regex: '^<objbase\.h>' # This has to be before initguid.h.
Priority: 1
- Regex: '^<(initguid|mmdeviceapi|windows|winsock2|ws2tcpip|shobjidl|atlbase|ole2|unknwn|tchar)\.h>'
- Regex: '^<(initguid|mmdeviceapi|windows|winsock2|ws2tcpip|shobjidl|atlbase|ole2|unknwn|tchar|ocidl)\.h>'
Priority: 2
# LINT.ThenChange(/tools/add_header.py:winheader)
# UIAutomation*.h need to be after base/win/atl.h.

@ -1066,6 +1066,8 @@ _BANNED_CPP_FUNCTIONS : Sequence[BanRule] = (
# PartitionAlloc's starscan, doesn't depend on base/. It can't use
# base::ConditionalVariable::TimedWait(..).
"base/allocator/partition_allocator/src/partition_alloc/starscan/pcscan_internal.cc",
# This uses openscreen API depending on std::chrono.
"components/openscreen_platform/task_runner.cc",
]
),
BanRule(

@ -3,8 +3,10 @@
// found in the LICENSE file.
#include "base/logging_win.h"
#include <initguid.h>
#include "base/memory/singleton.h"
#include <initguid.h> // NOLINT
namespace logging {

@ -16,15 +16,15 @@
// clang-format on
// Now include the real ATL headers.
#include <atlbase.h> // NOLINT(build/include_order)
#include <atlbase.h>
#include <atlcom.h> // NOLINT(build/include_order)
#include <atlcomcli.h> // NOLINT(build/include_order)
#include <atlctl.h> // NOLINT(build/include_order)
#include <atlhost.h> // NOLINT(build/include_order)
#include <atlsecurity.h> // NOLINT(build/include_order)
#include <atltypes.h> // NOLINT(build/include_order)
#include <atlwin.h> // NOLINT(build/include_order)
#include <atlcom.h>
#include <atlcomcli.h>
#include <atlctl.h>
#include <atlhost.h>
#include <atlsecurity.h>
#include <atltypes.h>
#include <atlwin.h>
// Undefine the poisonous defines
#include "base/win/windows_undefines.inc" // NOLINT(build/include)

@ -8,7 +8,7 @@
#include <objbase.h>
#include <initguid.h> // NOLINT - has to be last
#include <initguid.h>
#include "base/files/file_path.h"
#include "base/files/file_util.h"

@ -4,10 +4,12 @@
//
// Unit tests for event trace provider.
#include "base/win/event_trace_provider.h"
#include <new>
#include "testing/gtest/include/gtest/gtest.h"
#include <initguid.h> // NOLINT - has to be last
#include <initguid.h>
#include <new>
#include "testing/gtest/include/gtest/gtest.h"
namespace {

@ -4,12 +4,14 @@
#ifndef BASE_WIN_PROPVARUTIL_H_
#define BASE_WIN_PROPVARUTIL_H_
// clang-format off
// Check no prior poisonous defines were made.
#include "base/win/windows_defines.inc"
// Undefine before windows header will make the poisonous defines
#include "base/win/windows_undefines.inc"
// clang-format on
#include <propvarutil.h> // NOLINT(build/include_order)
#include <propvarutil.h>
// Undefine the poisonous defines
#include "base/win/windows_undefines.inc" // NOLINT(build/include)

@ -4,12 +4,14 @@
#ifndef BASE_WIN_SHLWAPI_H_
#define BASE_WIN_SHLWAPI_H_
// clang-format off
// Check no prior poisonous defines were made.
#include "base/win/windows_defines.inc"
// Undefine before windows header will make the poisonous defines
#include "base/win/windows_undefines.inc"
// clang-format on
#include <shlwapi.h> // NOLINT(build/include_order)
#include <shlwapi.h>
// Undefine the poisonous defines
#include "base/win/windows_undefines.inc" // NOLINT(build/include)

@ -4,12 +4,14 @@
#ifndef BASE_WIN_SPHELPER_H_
#define BASE_WIN_SPHELPER_H_
// clang-format off
// Check no prior poisonous defines were made.
#include "base/win/windows_defines.inc"
// Undefine before windows header will make the poisonous defines
#include "base/win/windows_undefines.inc"
// clang-format on
#include <sphelper.h> // NOLINT(build/include_order)
#include <sphelper.h>
// Undefine the poisonous defines
#include "base/win/windows_undefines.inc" // NOLINT(build/include)

@ -24,13 +24,14 @@
#error Windows.h was included inappropriately.
#endif
// clang-format off
// Make sure windows.h can be included after windows_types.h
#include "base/win/windows_types.h"
// clang-format on
// windows.h must be included before objidl.h
#include <windows.h> // NOLINT(build/include_order)
#include <windows.h>
#include <objidl.h> // NOLINT(build/include_order)
#include <objidl.h>
// Check that type sizes match.
static_assert(sizeof(CHROME_CONDITION_VARIABLE) == sizeof(CONDITION_VARIABLE),

@ -4,11 +4,11 @@
#include "chrome/app/main_dll_loader_win.h"
#include <windows.h> // NOLINT
#include <windows.h>
#include <stddef.h>
#include <stdint.h>
#include <userenv.h> // NOLINT
#include <userenv.h>
#include <memory>
#include <string>

@ -7,7 +7,7 @@
#ifndef CHROME_APP_MAIN_DLL_LOADER_WIN_H_
#define CHROME_APP_MAIN_DLL_LOADER_WIN_H_
#include <windows.h> // NOLINT
#include <windows.h>
#include <string>

@ -10,12 +10,12 @@
#define SECURITY_WIN32 1
#include <security.h>
#undef SECURITY_WIN32
#include <shobjidl.h> // NOLINT(build/include_order)
#include <shobjidl.h>
#include <DSRole.h> // NOLINT(build/include_order)
#include <iphlpapi.h> // NOLINT(build/include_order)
#include <powersetting.h> // NOLINT(build/include_order)
#include <propsys.h> // NOLINT(build/include_order)
#include <DSRole.h>
#include <iphlpapi.h>
#include <powersetting.h>
#include <propsys.h>
#include <wincred.h>
#include "base/files/file_path.h"

@ -6,8 +6,8 @@
#include <winsock2.h>
#include <windot11.h> // NOLINT
#include <wlanapi.h> // NOLINT
#include <windot11.h>
#include <wlanapi.h>
#include <wrl/client.h>
#include <algorithm>

@ -7,7 +7,7 @@
#include <ws2tcpip.h>
#include <iphlpapi.h> // NOLINT
#include <iphlpapi.h>
#include <roapi.h>
#include <windows.networking.connectivity.h>

@ -7,8 +7,7 @@
#include <ws2tcpip.h>
// iphlpapi.h must be included after ws2tcpip.h to use MIB_IF_TABLE2.
#include <iphlpapi.h> // NOLINT
#include <iphlpapi.h>
#include <string>
#include <vector>

@ -7,8 +7,7 @@
#include <ws2tcpip.h>
// iphlpapi.h must be included after ws2tcpip.h to use MIB_IF_TABLE2.
#include <iphlpapi.h> // NOLINT
#include <iphlpapi.h>
#include <string>
#include <vector>

@ -7,8 +7,7 @@
#include <ws2tcpip.h>
// iphlpapi.h must be included after ws2tcpip.h to use MIB_IF_TABLE2.
#include <iphlpapi.h> // NOLINT
#include <iphlpapi.h>
#include <vector>

@ -4,10 +4,10 @@
#include "chrome/browser/net/net_error_diagnostics_dialog.h"
#include <windows.h> // NOLINT
#include <winsock2.h> // NOLINT
#include <windows.h>
#include <winsock2.h>
#include <ndfapi.h> // NOLINT
#include <ndfapi.h>
#include <memory>
#include <string>

@ -26,11 +26,9 @@
#include <windows.h>
#endif
#include "chrome/common/logging_chrome.h"
#include <fstream> // NOLINT
#include <memory> // NOLINT
#include <string> // NOLINT
#include <fstream>
#include <memory>
#include <string>
#include "base/base_switches.h"
#include "base/command_line.h"
@ -52,6 +50,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/logging_chrome.h"
#include "content/public/common/content_switches.h"
#include "ipc/ipc_logging.h"

@ -6,7 +6,7 @@
#include <windows.h>
#include <shellapi.h> // NOLINT
#include <shellapi.h>
#include <stddef.h>
#include <stdlib.h>

@ -7,8 +7,8 @@
#include <vector>
#include "bluetooth_types.h" // NOLINT(build/include)
#include "chromecast_export.h" // NOLINT(build/include)
#include "bluetooth_types.h"
#include "chromecast_export.h"
namespace chromecast {
namespace bluetooth_v2_shlib {

@ -8,8 +8,8 @@
#include <cstdint>
#include <vector>
#include "bluetooth_types.h" // NOLINT(build/include)
#include "chromecast_export.h" // NOLINT(build/include)
#include "bluetooth_types.h"
#include "chromecast_export.h"
namespace chromecast {
namespace bluetooth_v2_shlib {

@ -8,7 +8,7 @@
#include <string>
#include <vector>
#include "chromecast_export.h" // NOLINT(build/include)
#include "chromecast_export.h"
namespace chromecast {

@ -8,7 +8,7 @@
#include <string>
#include <vector>
#include "chromecast_export.h" // NOLINT(build/include)
#include "chromecast_export.h"
namespace chromecast {

@ -4,7 +4,7 @@
#include "components/openscreen_platform/task_runner.h"
#include <chrono> // NOLINT
#include <chrono>
#include <utility>
#include "base/functional/bind.h"

@ -4,7 +4,7 @@
#include "components/payments/core/payments_validators.h"
#include <ostream> // NOLINT
#include <ostream>
#include "testing/gtest/include/gtest/gtest.h"

@ -20,7 +20,7 @@
#include "chromecast/cast_core/grpc/grpc_unary_handler.h"
#include "components/policy/test_support/client_storage.h"
#include "components/policy/test_support/embedded_policy_test_server.h"
#include "components/policy/test_support/remote_commands_service.castcore.pb.h" // NOLINT(build/include_directory)
#include "components/policy/test_support/remote_commands_service.castcore.pb.h"
#include "components/policy/test_support/remote_commands_state.h"
/*

@ -11,8 +11,8 @@
#endif
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "gpu/gles2_conform_support/egl/test_support.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "gpu/gles2_conform_support/egl/test_support.h" // NOLINT
// This file implements the main entry point for tests for command_buffer_gles2,
// the mode of command buffer where the code is compiled as a standalone dynamic

@ -4,8 +4,9 @@
#include "media/base/win/color_space_util_win.h"
#include <initguid.h> // NOLINT(build/include_order)
#include <mfapi.h> // NOLINT(build/include_order)
#include <initguid.h>
#include <mfapi.h>
#include "base/logging.h"
#include "media/base/video_color_space.h"

@ -4,15 +4,16 @@
#include "media/base/win/mf_helpers.h"
#include <d3d11.h>
#include <initguid.h>
#include <d3d11.h>
#include <ks.h>
#include <ksmedia.h>
#include <mfapi.h>
#include <mferror.h> // NOLINT(build/include_order)
#include <mferror.h>
#include <mfidl.h>
#include <mmreg.h> // NOLINT(build/include_order)
#include <wrl.h> // NOLINT(build/include_order)
#include <mmreg.h>
#include <wrl.h>
#include "base/check_op.h"
#include "base/win/scoped_co_mem.h"

@ -2,15 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Ensures MFAudioFormat_Xxx symbols are defined in mfapi.h which is included
// by media_foundation_audio_stream.h.
#include <initguid.h> // NOLINT(build/include_order)
#include "media/renderers/win/media_foundation_audio_stream.h"
#include <mferror.h> // NOLINT(build/include_order)
#include <mmreg.h> // NOLINT(build/include_order)
#include <wrl.h> // NOLINT(build/include_order)
#include <mferror.h>
#include <mmreg.h>
#include <wrl.h>
#include "base/win/scoped_co_mem.h"
#include "media/base/audio_codecs.h"

@ -5,14 +5,15 @@
#ifndef MEDIA_RENDERERS_WIN_MEDIA_FOUNDATION_AUDIO_STREAM_H_
#define MEDIA_RENDERERS_WIN_MEDIA_FOUNDATION_AUDIO_STREAM_H_
#include <initguid.h>
#include <mfapi.h>
#include <mfidl.h>
#include "media/base/win/mf_helpers.h"
#include "media/renderers/win/media_foundation_stream_wrapper.h"
#include "media/base/media_log.h"
#include "media/base/win/mf_helpers.h"
#include "media/media_buildflags.h"
#include "media/renderers/win/media_foundation_stream_wrapper.h"
namespace media {

@ -4,10 +4,11 @@
#include "media/renderers/win/media_foundation_video_stream.h"
#include <initguid.h> // NOLINT(build/include_order)
#include <mfapi.h> // NOLINT(build/include_order)
#include <mferror.h> // NOLINT(build/include_order)
#include <wrl.h> // NOLINT(build/include_order)
#include <initguid.h>
#include <mfapi.h>
#include <mferror.h>
#include <wrl.h>
#include "base/metrics/histogram_functions.h"
#include "base/numerics/safe_conversions.h"

@ -5,9 +5,9 @@
#ifndef PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
#define PRINTING_PRINTING_CONTEXT_SYSTEM_DIALOG_WIN_H_
#include <ocidl.h> // NOLINT(build/include_order)
#include <ocidl.h>
#include <commdlg.h> // Must come after ocidl.h.
#include <commdlg.h>
#include <string>

@ -4,7 +4,7 @@
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/abstract_range.h"

@ -26,7 +26,8 @@
#include "third_party/blink/renderer/core/editing/position.h"
#include <stdio.h>
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"

@ -4,7 +4,7 @@
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"

@ -4,7 +4,8 @@
#include "third_party/blink/renderer/core/editing/state_machines/backspace_state_machine.h"
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/platform/text/character.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"
#include "third_party/blink/renderer/platform/wtf/text/unicode.h"

@ -4,7 +4,8 @@
#include "third_party/blink/renderer/core/editing/state_machines/backward_grapheme_boundary_state_machine.h"
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/core/editing/state_machines/state_machine_util.h"
#include "third_party/blink/renderer/core/editing/state_machines/text_segmentation_machine_state.h"
#include "third_party/blink/renderer/platform/text/character.h"

@ -4,7 +4,8 @@
#include "third_party/blink/renderer/core/editing/state_machines/forward_grapheme_boundary_state_machine.h"
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/core/editing/state_machines/state_machine_util.h"
#include "third_party/blink/renderer/core/editing/state_machines/text_segmentation_machine_state.h"
#include "third_party/blink/renderer/platform/text/character.h"

@ -4,7 +4,8 @@
#include "third_party/blink/renderer/core/editing/state_machines/text_segmentation_machine_state.h"
#include <ostream> // NOLINT
#include <ostream>
#include "base/check_op.h"
namespace blink {

@ -5,7 +5,8 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_STATE_MACHINES_TEXT_SEGMENTATION_MACHINE_STATE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_EDITING_STATE_MACHINES_TEXT_SEGMENTATION_MACHINE_STATE_H_
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/core/core_export.h"
namespace blink {

@ -4,7 +4,8 @@
#include "third_party/blink/renderer/core/editing/text_affinity.h"
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/public/web/web_ax_enums.h"
namespace blink {

@ -27,7 +27,8 @@
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include <ostream> // NOLINT
#include <ostream>
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/text.h"

@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/payments/payment_request.h"
#include <ostream>
#include <ostream> // NOLINT
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_details_init.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_options.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/modules/payments/payment_request.h"
#include "third_party/blink/renderer/modules/payments/payment_test_helper.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"

@ -4,7 +4,7 @@
#include "third_party/blink/renderer/modules/payments/payments_validators.h"
#include <ostream> // NOLINT
#include <ostream>
#include "base/test/scoped_command_line.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"

@ -369,6 +369,8 @@ def SerializeIncludes(includes):
'<mmdeviceapi.h>',
# Must be before emi.h.
'<initguid.h>',
# Must be before commdlg.h.
'<ocidl.h>',
]
# LINT.ThenChange(/.clang-format:winheader)

@ -11,7 +11,7 @@
#include <numeric>
#include <vector>
#include "libtest_array.h" // NOLINT(build/include)
#include "libtest_array.h"
extern "C" {
int GetSum();

@ -34,7 +34,7 @@ enum ExamplesActionIds : actions::ActionId {
// Note that this second include is not redundant. The second inclusion of the
// .inc file serves to undefine the macros the first inclusion defined.
#include "ui/actions/action_id_macros.inc" // NOLINT
#include "ui/actions/action_id_macros.inc" // NOLINT(build/include)
} // namespace views::examples

@ -76,7 +76,7 @@ enum ExamplesColorIds : ui::ColorId {
// Note that this second include is not redundant. The second inclusion of the
// .inc file serves to undefine the macros the first inclusion defined.
#include "ui/color/color_id_macros.inc" // NOLINT
#include "ui/color/color_id_macros.inc" // NOLINT(build/include)
} // namespace views::examples