forked from brave/brave-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chromium_presubmit_config.json5
200 lines (193 loc) · 8.82 KB
/
chromium_presubmit_config.json5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
"disabled_checks": {
// Checks defined in the //PRESUBMIT.py global scope.
"//PRESUBMIT.py": [
// We don't use OWNERS files.
"CheckSecurityOwners",
// This validates added strings with screenshot tests which we don't use.
"CheckStrings",
// We don't update upstream pydeps.
"CheckPydepsNeedsUpdating",
// Disable check for .*google.* images being added to the repository.
"CheckNoProductIconsAddedToPublicRepo",
// Disable check for Google support URLs.
"CheckGoogleSupportAnswerUrlOnUpload",
// Disable check for hardcoded Google API urls.
"CheckHardcodedGoogleHostsInLowerLayers",
],
// Checks defined in depot_tools/presubmit_canned_checks.py.
"canned": [
// Disable Chromium license check. We use our own checker.
"CheckLicense",
// We don't use OWNERS files.
"CheckOwnersFormat",
"CheckOwners",
// We don't use AUTHORS file.
"CheckAuthorizedAuthor",
// We don't upload change to Chromium version control.
"CheckChangeWasUploaded",
"CheckChangeHasBugField",
"CheckTreeIsOpen",
// We run our own format check.
"CheckPatchFormatted",
// We don't use Chromium LSC process for Brave repository.
"CheckLargeScaleChange",
],
},
// Checks that should trigger presubmit errors instead of warnings.
"checks_to_force_presubmit_errors": {
"//PRESUBMIT.py": [
"CheckBuildConfigMacrosWithoutInclude",
"CheckForSuperfluousStlIncludesInHeaders",
"CheckForIncludeGuards",
"CheckGnGlobForward",
"CheckNewHeaderWithoutGnChangeOnUpload",
],
"canned": [
"CheckChangeLintsClean",
"GetPylint",
],
},
// Additional files to check (extends InputApi.DEFAULT_FILES_TO_CHECK).
"additional_default_files_to_check": [
".+\\.jsx$",
".+\\.tsx$",
],
// Files to skip in all checks.
"default_files_to_skip": [
"\\.storybook/",
"ios/brave-ios/Sources/Brave/Frontend/UserContent/UserScripts/Scripts_Dynamic/Scripts/Sandboxed/DarkReaderScript.js",
"components/brave_wallet/resources/solana_web3_script\\.js",
"third_party/rust/",
"tools/crates/",
"win_build_output/",
"third_party/ios_deps/",
],
// Regex to match function names in the current presubmit stack trace. Matched
// functions are used in `per_check_files_to_skip` filter.
"check_function_regex": "_?Check",
// Files to skip per check.
"per_check_files_to_skip": {
// Permanent ignores.
"CheckNewHeaderWithoutGnChangeOnUpload": ["chromium_src/"],
"CheckForCcIncludes": ["chromium_src/"],
"CheckForRelativeIncludes": ["chromium_src/"],
"CheckParseErrors": [
".*tsconfig\\.json",
"components/brave_ads/core/test/data/invalid\\.json",
],
"CheckNoBannedFunctions": [
// Use `ban_rule_excluded_paths` instead.
],
"CheckNoJsInIos": ["ios/brave-ios/"],
"CheckNoDeprecatedCss": ["ios/brave-ios/"],
// Checks to be fixed.
"CheckUnwantedDependencies": [".*\\.java"],
"CheckSpamLogging": [
"browser/browsing_data/brave_clear_browsing_data\\.cc",
"chromium_src/chrome/browser/ui/startup/startup_browser_creator\\.cc",
"components/brave_vpn/winvpntool\\.cc",
"components/permissions/permission_lifetime_utils\\.cc",
"components/tor/tor_launcher_factory\\.cc",
"components/webcompat_reporter/browser/webcompat_report_uploader\\.cc",
],
"CheckUniquePtrOnUpload": [
"components/brave_sync/qr_code_data\\.cc",
"components/brave_news/browser/direct_feed_controller\\.cc",
"components/brave_wallet/browser/tx_service\\.cc",
"components/brave_wallet/common/eth_sign_typed_data_helper\\.cc",
"components/tor/tor_profile_service_impl\\.cc",
],
"_CheckAndroidCrLogUsage": [
"android/java/org/chromium/base/BraveCommandLineInitUtil\\.java",
"android/java/org/chromium/chrome/browser/BraveAdaptiveCaptchaUtils\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/fragments/EditVisibleAssetsBottomSheetDialogFragment\\.java",
"android/java/org/chromium/chrome/browser/help/BraveHelpAndFeedbackLauncher\\.java",
"android/java/org/chromium/chrome/browser/search_engines/settings/BraveSearchEngineAdapter\\.java",
"android/java/org/chromium/chrome/browser/settings/BravePreferenceDialogFragment\\.java",
"android/java/org/chromium/chrome/browser/upgrade/BraveUpgradeJobIntentServiceImpl\\.java",
],
"_CheckAndroidToastUsage": [
"android/java/org/chromium/chrome/browser/brave_news/BraveNewsBottomSheetDialogFragment\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/activities/AccountPrivateKeyActivity\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/activities/NetworkSelectorActivity\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/fragments/PortfolioFragment\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/fragments/onboarding_fragments/BackupWalletFragment\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/fragments/onboarding_fragments/SecurePasswordFragment\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/fragments/onboarding_fragments/UnlockWalletFragment\\.java",
"android/java/org/chromium/chrome/browser/crypto_wallet/modal/BraveWalletPanel\\.java",
"android/java/org/chromium/chrome/browser/rate/RateDialogFragment\\.java",
"android/java/org/chromium/chrome/browser/settings/BraveStatsPreferences\\.java",
"android/java/org/chromium/chrome/browser/settings/BraveSyncScreensPreference\\.java",
"android/java/org/chromium/chrome/browser/settings/developer/BraveQAPreferences\\.java",
"android/java/org/chromium/chrome/browser/util/BraveDbUtil\\.java",
],
"CheckForDeprecatedOSMacros": [
"browser/ntp_background/custom_background_file_manager\\.h",
"browser/ntp_background/ntp_custom_background_images_service_delegate\\.cc",
"browser/ui/webui/new_tab_page/brave_new_tab_page_handler\\.cc",
"components/brave_sync/network_time_helper\\.cc",
],
"CheckConsistentGrdChanges": [
"browser/ui/android/strings/android_brave_strings\\.grd",
],
"CheckRawPtrUsage": [
"components/brave_search/renderer/brave_search_default_js_handler\\.h",
"components/brave_search/renderer/brave_search_fallback_js_handler\\.h",
"components/brave_search/renderer/brave_search_service_worker_holder\\.h",
"components/brave_wallet/renderer/js_ethereum_provider\\.h",
"components/content_settings/renderer/brave_content_settings_agent_impl_autoplay_browsertest\\.cc",
"components/cosmetic_filters/renderer/cosmetic_filters_js_handler\\.h",
"components/speedreader/renderer/speedreader_js_handler\\.h",
],
"CheckWebDevStyle": [
"components/speedreader/resources/speedreader-desktop.css",
"components/speedreader/resources/third_party/",
"components/webpack/gen-webpack-grd\\.js",
"test/data/speedreader/",
],
"CheckStableMojomChanges": [
"components/brave_rewards/common/mojom/rewards_engine\\.mojom",
]
},
// Additional excludes to _BANRULE_* lists in //PRESUBMIT.py.
//
// Maps BanRule.pattern -> BanRule.excluded_paths.
"ban_rule_excluded_paths": {
"import android.annotation.TargetApi;": [
"android/java/org/chromium/chrome/browser/qrreader/CameraSource\\.java",
"browser/notifications/android/java/src/org/chromium/chrome/browser/notifications/BraveNotificationManagerProxyImpl\\.java",
],
"/\\s+UTF8String\\s*]": [
"base/mac/conversions\\.h",
"browser/mac/sparkle_glue\\.mm",
],
"/\\bstd::function\\b": [
"chromium_src/chrome/browser/ui/views/frame/browser_non_client_frame_view_factory_views\\.cc",
"ios/browser/api/bookmarks/exporter/brave_bookmarks_exporter\\.mm",
"ios/browser/api/bookmarks/importer/brave_bookmarks_importer\\.mm",
],
"/\\bstd::shared_ptr\\b": [
"browser/net/.*",
"ios/browser/api/certificate/brave_certificate\\.mm",
"ios/browser/api/net/certificate_utility\\.mm",
],
"/\\bstd::sto(i|l|ul|ll|ull)\\b": [
"components/brave_wallet/browser/rlp_encode_unittest\\.cc",
"components/brave_wallet/common/eth_address\\.cc",
"utility/importer/chrome_importer\\.cc",
],
"/\\busing namespace ": [
"browser/ui/webui/new_tab_page/brave_new_tab_ui_browsertest\\.cc",
"browser/ui/webui/private_new_tab_page/brave_private_new_tab_page_browsertest\\.cc",
"chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest\\.cc",
"components/brave_shields/browser/ad_block_engine\\.cc",
],
"/v8::Extension\\(": [
"components/safe_builtins/renderer/safe_builtins\\.cc",
],
"StringFromGUID2": [
"chromium_src/chrome/install_static/brave_install_util_unittest\\.cc",
],
},
}