build: lint patches for trailing whitespace (#26007)
This commit is contained in:
parent
6b6ffbdd10
commit
042ebdd5b0
6 changed files with 17 additions and 12 deletions
|
@ -81,7 +81,7 @@ index 5575c90cf05ec43bc787711f1d44b8dd58ead99c..a544d836159522751c1262370d8c1562
|
||||||
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
|
||||||
#if defined(OS_APPLE)
|
#if defined(OS_APPLE)
|
||||||
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
|
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
|
||||||
index 31fa3d22a28cb673a1eac983acafb7bcd484e6ca..58d52c207f12dd329a0cb8593af5f76ab5ba70f1 100644
|
index 31fa3d22a28cb673a1eac983acafb7bcd484e6ca..e1bfab6b716fa5d2f552b7af149748b3b0dc0a23 100644
|
||||||
--- a/components/viz/service/display/gl_renderer.cc
|
--- a/components/viz/service/display/gl_renderer.cc
|
||||||
+++ b/components/viz/service/display/gl_renderer.cc
|
+++ b/components/viz/service/display/gl_renderer.cc
|
||||||
@@ -88,6 +88,9 @@
|
@@ -88,6 +88,9 @@
|
||||||
|
@ -121,7 +121,7 @@ index 31fa3d22a28cb673a1eac983acafb7bcd484e6ca..58d52c207f12dd329a0cb8593af5f76a
|
||||||
tint_gl_composited_content_,
|
tint_gl_composited_content_,
|
||||||
ShouldApplyRoundedCorner(quad)),
|
ShouldApplyRoundedCorner(quad)),
|
||||||
- CurrentRenderPassColorSpace(), CurrentRenderPassColorSpace());
|
- CurrentRenderPassColorSpace(), CurrentRenderPassColorSpace());
|
||||||
+ PATCH_CS(CurrentRenderPassColorSpace()),
|
+ PATCH_CS(CurrentRenderPassColorSpace()),
|
||||||
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
+ PATCH_CS(CurrentRenderPassColorSpace()));
|
||||||
|
|
||||||
gfx::ColorSpace quad_color_space = gfx::ColorSpace::CreateSRGB();
|
gfx::ColorSpace quad_color_space = gfx::ColorSpace::CreateSRGB();
|
||||||
|
|
|
@ -7,7 +7,7 @@ This tweaks Chrome's Accessibility support at chrome://accessibility
|
||||||
to make it usable from Electron by removing Profile references.
|
to make it usable from Electron by removing Profile references.
|
||||||
|
|
||||||
diff --git a/chrome/browser/accessibility/accessibility_ui.cc b/chrome/browser/accessibility/accessibility_ui.cc
|
diff --git a/chrome/browser/accessibility/accessibility_ui.cc b/chrome/browser/accessibility/accessibility_ui.cc
|
||||||
index 42d79b5651e204dc8014489f8feb6b6ad7994d8c..77ca7e88b9e5c2f1dd80d28452588f85a1120169 100644
|
index 42d79b5651e204dc8014489f8feb6b6ad7994d8c..bed9a4f98f566d368a891a8247f3e528f9db910d 100644
|
||||||
--- a/chrome/browser/accessibility/accessibility_ui.cc
|
--- a/chrome/browser/accessibility/accessibility_ui.cc
|
||||||
+++ b/chrome/browser/accessibility/accessibility_ui.cc
|
+++ b/chrome/browser/accessibility/accessibility_ui.cc
|
||||||
@@ -19,7 +19,10 @@
|
@@ -19,7 +19,10 @@
|
||||||
|
@ -101,7 +101,7 @@ index 42d79b5651e204dc8014489f8feb6b6ad7994d8c..77ca7e88b9e5c2f1dd80d28452588f85
|
||||||
+#if 0
|
+#if 0
|
||||||
PrefService* pref = Profile::FromWebUI(web_ui())->GetPrefs();
|
PrefService* pref = Profile::FromWebUI(web_ui())->GetPrefs();
|
||||||
bool internal = pref->GetBoolean(prefs::kShowInternalAccessibilityTree);
|
bool internal = pref->GetBoolean(prefs::kShowInternalAccessibilityTree);
|
||||||
+#endif
|
+#endif
|
||||||
std::string accessibility_contents =
|
std::string accessibility_contents =
|
||||||
- web_contents->DumpAccessibilityTree(internal, property_filters);
|
- web_contents->DumpAccessibilityTree(internal, property_filters);
|
||||||
+ web_contents->DumpAccessibilityTree(true, property_filters);
|
+ web_contents->DumpAccessibilityTree(true, property_filters);
|
||||||
|
|
|
@ -25,7 +25,7 @@ index f63f7f2674d9562f57dea4f9c9f473aa595a0c5f..78a46dbea7ff31209748ef47d5417253
|
||||||
// Returns true if duplex mode is set.
|
// Returns true if duplex mode is set.
|
||||||
bool SetDuplexModeInPrintSettings(mojom::DuplexMode mode);
|
bool SetDuplexModeInPrintSettings(mojom::DuplexMode mode);
|
||||||
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
|
diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm
|
||||||
index aa950b59390fdae9a5152affb7a7438cb78eb6f4..3ec9ee0ee464960a48d23f5000137cc44027e9b1 100644
|
index aa950b59390fdae9a5152affb7a7438cb78eb6f4..9b5307bda7b73cb502fe185be2a7c02e23a7722c 100644
|
||||||
--- a/printing/printing_context_mac.mm
|
--- a/printing/printing_context_mac.mm
|
||||||
+++ b/printing/printing_context_mac.mm
|
+++ b/printing/printing_context_mac.mm
|
||||||
@@ -189,7 +189,8 @@ PMPaper MatchPaper(CFArrayRef paper_list,
|
@@ -189,7 +189,8 @@ PMPaper MatchPaper(CFArrayRef paper_list,
|
||||||
|
@ -45,7 +45,7 @@ index aa950b59390fdae9a5152affb7a7438cb78eb6f4..3ec9ee0ee464960a48d23f5000137cc4
|
||||||
+bool PrintingContextMac::SetPrintRangeInPrintSettings(const PageRanges& ranges) {
|
+bool PrintingContextMac::SetPrintRangeInPrintSettings(const PageRanges& ranges) {
|
||||||
+ // Default is already NSPrintAllPages - we can safely bail.
|
+ // Default is already NSPrintAllPages - we can safely bail.
|
||||||
+ if (ranges.empty())
|
+ if (ranges.empty())
|
||||||
+ return true;
|
+ return true;
|
||||||
+
|
+
|
||||||
+ auto* print_settings =
|
+ auto* print_settings =
|
||||||
+ static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
|
+ static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
|
||||||
|
@ -100,14 +100,14 @@ index d3c8677f30d72efc49b28f293260c74c7b8d8b4e..f6e66aaa58ab1881d64dcbb320ae8b5a
|
||||||
} else {
|
} else {
|
||||||
// No need to bother, we don't know how many pages are available.
|
// No need to bother, we don't know how many pages are available.
|
||||||
diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc
|
diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc
|
||||||
index f2ed36e1258f4f3ef1bfce972e215e3d5d7335b6..405839e9f944f70106c1c203652044c3abfade3d 100644
|
index f2ed36e1258f4f3ef1bfce972e215e3d5d7335b6..5b38bf1369a68546f0aeea8948abba995c65e7f7 100644
|
||||||
--- a/ui/gtk/printing/print_dialog_gtk.cc
|
--- a/ui/gtk/printing/print_dialog_gtk.cc
|
||||||
+++ b/ui/gtk/printing/print_dialog_gtk.cc
|
+++ b/ui/gtk/printing/print_dialog_gtk.cc
|
||||||
@@ -239,6 +239,24 @@ void PrintDialogGtk::UpdateSettings(
|
@@ -239,6 +239,24 @@ void PrintDialogGtk::UpdateSettings(
|
||||||
|
|
||||||
gtk_print_settings_set_n_copies(gtk_settings_, settings->copies());
|
gtk_print_settings_set_n_copies(gtk_settings_, settings->copies());
|
||||||
gtk_print_settings_set_collate(gtk_settings_, settings->collate());
|
gtk_print_settings_set_collate(gtk_settings_, settings->collate());
|
||||||
+
|
+
|
||||||
+ auto print_ranges = settings->ranges();
|
+ auto print_ranges = settings->ranges();
|
||||||
+ if (!print_ranges.empty()) {
|
+ if (!print_ranges.empty()) {
|
||||||
+ // Tell the system that we only intend to print a subset of pages.
|
+ // Tell the system that we only intend to print a subset of pages.
|
||||||
|
|
|
@ -12,14 +12,14 @@ rendering and there is no signal from browser process on this event
|
||||||
to identify it.
|
to identify it.
|
||||||
|
|
||||||
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
|
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
|
||||||
index 694f63ecd2de241fd1a8b7b529bbd4d1bea78337..cc9679eb86f85239f5612d8db8200db5392f5bc5 100644
|
index 694f63ecd2de241fd1a8b7b529bbd4d1bea78337..705d24cb09a2a8b07ac7acd21b18e2e3483856bf 100644
|
||||||
--- a/content/browser/gpu/gpu_data_manager_impl.cc
|
--- a/content/browser/gpu/gpu_data_manager_impl.cc
|
||||||
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
|
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
|
||||||
@@ -229,6 +229,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
|
@@ -229,6 +229,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
|
||||||
base::AutoLock auto_lock(lock_);
|
base::AutoLock auto_lock(lock_);
|
||||||
private_->TerminateInfoCollectionGpuProcess();
|
private_->TerminateInfoCollectionGpuProcess();
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+bool GpuDataManagerImpl::DxdiagDx12VulkanRequested() const {
|
+bool GpuDataManagerImpl::DxdiagDx12VulkanRequested() const {
|
||||||
+ base::AutoLock auto_lock(lock_);
|
+ base::AutoLock auto_lock(lock_);
|
||||||
+ return private_->DxdiagDx12VulkanRequested();
|
+ return private_->DxdiagDx12VulkanRequested();
|
||||||
|
|
|
@ -419,7 +419,7 @@ index 894ac47e596c1c96a7e0659be80ed8a5629d0304..eca797a24df79b8502b9698e6ed8830a
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm
|
diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm
|
||||||
index 1db129740992672a4e8be8100da18b6813f1a4f8..5b1e456020ac859c826dbef2826cacf3bb60108b 100644
|
index 1db129740992672a4e8be8100da18b6813f1a4f8..dc18d623869e815d4d1ef64ad8bceb6948f5cc9e 100644
|
||||||
--- a/content/renderer/theme_helper_mac.mm
|
--- a/content/renderer/theme_helper_mac.mm
|
||||||
+++ b/content/renderer/theme_helper_mac.mm
|
+++ b/content/renderer/theme_helper_mac.mm
|
||||||
@@ -7,11 +7,11 @@
|
@@ -7,11 +7,11 @@
|
||||||
|
@ -445,7 +445,7 @@ index 1db129740992672a4e8be8100da18b6813f1a4f8..5b1e456020ac859c826dbef2826cacf3
|
||||||
+#else
|
+#else
|
||||||
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
+ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||||
+ NSString *default_key = @"CGFontRenderingGetFontSmoothingDisabled";
|
+ NSString *default_key = @"CGFontRenderingGetFontSmoothingDisabled";
|
||||||
+ // Check that key exists since boolForKey defaults to NO when the
|
+ // Check that key exists since boolForKey defaults to NO when the
|
||||||
+ // key is missing and this key in fact defaults to YES;
|
+ // key is missing and this key in fact defaults to YES;
|
||||||
+ if ([defaults objectForKey:default_key] == nil)
|
+ if ([defaults objectForKey:default_key] == nil)
|
||||||
+ return false;
|
+ return false;
|
||||||
|
|
|
@ -186,6 +186,11 @@ const LINTERS = [{
|
||||||
console.warn(`Patch file '${f}' has no description. Every patch must contain a justification for why the patch exists and the plan for its removal.`);
|
console.warn(`Patch file '${f}' has no description. Every patch must contain a justification for why the patch exists and the plan for its removal.`);
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
|
const trailingWhitespace = patchText.split('\n').filter(line => line.startsWith('+')).some(line => /\s+$/.test(line));
|
||||||
|
if (trailingWhitespace) {
|
||||||
|
console.warn(`Patch file '${f}' has trailing whitespace on some lines.`);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
Loading…
Reference in a new issue