0
Commit Graph

316 Commits

Author SHA1 Message Date
Daniel Cheng
8971922e9c Allow most of <ranges> but explicitly ban views
Change-Id: I67befc6d5cc18ab3ce43e6e3a1ad68f8dba878fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5668999
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1323174}
2024-07-04 04:59:29 +00:00
Daniel Cheng
566634ff1d git cl format --python PRESUBMIT.py and PRESUBMIT_test.py
Skipping the presubmit, because ironically enough, PRESUBMIT.py and
PRESUBMIT_test.py trigger a number of pre-existing presubmit violations.

No-Presubmit: true
Change-Id: I9aabeb8496a0582d6cb92af90db4ef3b32f70b04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5668998
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321358}
2024-06-29 14:56:53 +00:00
Scott Lee
bf6a094494 Disable DEPS review enforcement for cross-repo DEPS
When a new DEP is added, the presubmit check enforces reviews from
the owner of the additional DEP. However, when the DEP is from another
repo, the enforcement becomes trickier especially it is from a different
host.

This patch disables the check if a newly added DEP is from a submodule.

Change-Id: Id7c2feac005c1c769313dedb254d5a0b641ff68b
Bug: 324496840
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5656359
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1320079}
2024-06-26 22:59:39 +00:00
Bartek Nowierski
49b1a4582d [BRP] Take a step towards enforcing raw_ptr/ref in Renderer code
We intend to exclude only a handful specific sub-directories (for perf
reasons). This CL removes the broad exclusions from the rewriter and
the enforcing clang plugin.

There is a risk that by the time the plugin rolls into Chromium,
someone will add a raw pointer, which will cause the plugin
to error out and block the roll-out. Therefore, add those broad
exclusions into BUILD.gn temporarily -- they'll be removed after
the plugin rolls, once we confirm that all pointers in those
directories are properly rewritten.

In other words, this CL doesn't change the clang plugin enforcement
behavior.

Bug: 40064499, 331846123
Change-Id: Ia95e8df846d167521a5ac43cc63e556002702ee9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5600329
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312344}
2024-06-08 00:24:35 +00:00
Bartek Nowierski
f9f1b6635c [BRP] Semi-automated T* -> raw_ptr<T> Renderer rewrite 'refresh'
This time we're allowing pointers in third_party/blink/public/web/, but also covering new ones that popped up under /renderer/

No performance regression has been observed on benchmarks:
https://pinpoint-dot-chromeperf.appspot.com/job/12b5674f810000
https://pinpoint-dot-chromeperf.appspot.com/job/15e0c119810000
https://pinpoint-dot-chromeperf.appspot.com/job/11a435cd810000
https://pinpoint-dot-chromeperf.appspot.com/job/128306a7810000

Bug: 40064499, 331846123
Change-Id: I0d5cb5cae26a084ba4ca9195e432858059b09ffd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5602549
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1311752}
2024-06-07 04:59:00 +00:00
Bret Sepulveda
0ca7bfbfb5 Revert "[PRESUBMIT] Check if files are written to a dep dir"
This reverts commit 367476a325.

Reason for revert: Causing presubmit bot failures. See b/345023320, or ask battre@ for more information.

Original change's description:
> [PRESUBMIT] Check if files are written to a dep dir
>
> No files should be written to a directory that's used by CIPD or GCS, as
> defined in DEPS. Git already doesn't allow files to be written to a
> directory that's a gitlink.
>
> Bug: 343199633
> Change-Id: Ica929b7c6e5ca84082f24343869014e9eccfde58
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5578422
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1310264}

Bug: 343199633
Change-Id: Idab125b2a0e2a7c673927ba6be4627c7ecb3fbe6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5598862
Owners-Override: Bret Sepulveda <bsep@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310492}
2024-06-05 08:50:42 +00:00
Josip Sokcevic
367476a325 [PRESUBMIT] Check if files are written to a dep dir
No files should be written to a directory that's used by CIPD or GCS, as
defined in DEPS. Git already doesn't allow files to be written to a
directory that's a gitlink.

Bug: 343199633
Change-Id: Ica929b7c6e5ca84082f24343869014e9eccfde58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5578422
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1310264}
2024-06-04 22:23:34 +00:00
Rasika Navarange
277cd66085 [Chrome Stdlib]: Support renaming of test data objects
Allow files to be renamed while keeping the same sha256.

The previous version of the presubmit fails when we try to do this as it checks that when a file is removed, the matching hash is also removed from the DEPS file. In the case of renaming the hash stays the same and we want to explicitly allow this.

Change-Id: Iedb384858d45f078b04740b2937650061af1d861
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5575129
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309836}
2024-06-04 10:14:59 +00:00
Erik Chen
f58f7206c3 Add presubmits warnings for commonly misused functions.
Change-Id: I0b9c673dfcb13e29d4a384c39e1721cdb7c2d231
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5591890
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309589}
2024-06-03 21:21:52 +00:00
Rasika Navarange
08e542168e [Chrome Stdlib] Move .sha256 files to separate directory from test data
We need to move the .sha256 files to a separate directory to the actual
test data. This is because Cog does not support contents of a directory
coming from multiple sources i.e. both Git and GCS. So we need a
separate directory for files coming from GCS from the files coming from
Git.

Change-Id: I16fee14405a2b4faee842e01dd1e94ed2ccf0eec
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5582049
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1308600}
2024-05-31 13:31:26 +00:00
Allen Bauer
5839eb218f Add PRESUBMIT warnings for WIDGET_OWNS_NATIVE_WIDGET and
NATIVE_WIDGET_OWNS_WIDGET

We are refactoring Views code with an eye towards changing the ownership model of widgets to CLIENT_OWNS_WIDGET as the only ownership model. This will warn developers when they are landing code using one of these two ownership models.


Change-Id: I77c8911d3ab5669fb6f148a650465c4f43e2d09b
Bug: 339619005
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5577858
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/main@{#1306988}
2024-05-28 20:20:06 +00:00
Lei Zhang
d84f951ae2 Make CheckForIncludeGuards() presubmit fire warning for incorrect #endif
Check headers to make sure the "#endif // GUARD" line matches the
"#if GUARD" line.

Change-Id: I9d11dc8cf42f4058bd3bb1cd9e27a3269251a301
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5577500
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1306964}
2024-05-28 19:43:30 +00:00
Rasika Navarange
c2d33d2eab Reland "[Chrome Stdlib] Use DEPS to download diff test data"
This is a reland of commit 6c8f992499

This reland adds the deps entry for chrome_5672_histograms.pftrace.gz
which was missing in the original CL, causing b/342182426 which caused
the original CL to be reverted.

Original change's description:
> [Chrome Stdlib] Use DEPS to download diff test data
>
> We want to download Perfetto test data via GCS dependencies in DEPS
> rather than Perfetto's test_data script. To make this change we:
>
> 1. Modify the test_data.py script to wrap
>    `upload_to_google_storage_first_class.py` instead of Perfetto's
>    `test_data` script.
> 2. Add a Presubmit check to ensure the .sha256 files are in sync with
>    the deps entries.
> 3. Update docs to give instructions for the new workflow
>
> Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
> Bug: 312895063
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Commit-Queue: Rasika Navarange <rasikan@google.com>
> Reviewed-by: Dominic Battre <battre@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1304407}

Bug: 312895063
Change-Id: I6bcd74324612e5c49ae59bee3f0b20f673d70b81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5562906
Reviewed-by: Dominic Battre <battre@chromium.org>
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Cr-Commit-Position: refs/heads/main@{#1305095}
2024-05-23 15:19:02 +00:00
Rasika Navarange
303cdf240f Revert "[Chrome Stdlib] Use DEPS to download diff test data"
This reverts commit 6c8f992499.

Reason for revert: b/342182426

Original change's description:
> [Chrome Stdlib] Use DEPS to download diff test data
>
> We want to download Perfetto test data via GCS dependencies in DEPS
> rather than Perfetto's test_data script. To make this change we:
>
> 1. Modify the test_data.py script to wrap
>    `upload_to_google_storage_first_class.py` instead of Perfetto's
>    `test_data` script.
> 2. Add a Presubmit check to ensure the .sha256 files are in sync with
>    the deps entries.
> 3. Update docs to give instructions for the new workflow
>
> Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
> Bug: 312895063
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
> Reviewed-by: Stephen Nusko <nuskos@chromium.org>
> Commit-Queue: Rasika Navarange <rasikan@google.com>
> Reviewed-by: Dominic Battre <battre@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1304407}

Bug: 312895063
Change-Id: I07872d3e5bdc550a6795197d396c11dadbbd3a3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5558666
Commit-Queue: Zachary Tan <tanzachary@chromium.org>
Auto-Submit: Rasika Navarange <rasikan@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Zachary Tan <tanzachary@chromium.org>
Owners-Override: Zachary Tan <tanzachary@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1304506}
2024-05-22 16:44:43 +00:00
Rasika Navarange
6c8f992499 [Chrome Stdlib] Use DEPS to download diff test data
We want to download Perfetto test data via GCS dependencies in DEPS
rather than Perfetto's test_data script. To make this change we:

1. Modify the test_data.py script to wrap
   `upload_to_google_storage_first_class.py` instead of Perfetto's
   `test_data` script.
2. Add a Presubmit check to ensure the .sha256 files are in sync with
   the deps entries.
3. Update docs to give instructions for the new workflow

Change-Id: I20616c95553f93603e338dd9fa47e84facfb60d8
Bug: 312895063
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545295
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Rasika Navarange <rasikan@google.com>
Reviewed-by: Dominic Battre <battre@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1304407}
2024-05-22 14:09:23 +00:00
Victor Hugo Vianna Silva
dbe815499a [android/ios/presubmit] Warn about deprecated sync consent predicates
Bug: 40066949
Change-Id: Ib3dda14f33c6bea7ffcd12b6f8803d6d1a5e4095
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5553534
Reviewed-by: Dominic Battre <battre@chromium.org>
Auto-Submit: Victor Vianna <victorvianna@google.com>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/main@{#1303675}
2024-05-21 11:09:15 +00:00
Glen Robertson
9142ffd708 Fix false-positive in unique_ptr presubmit check with mismatched <>
Presubmit was preventing upload of crrev.com/c/5534806 due to changed
line:
` std::unique_ptr<WebAppInstallInfo>>(`
being interpreted as a call to the unique_ptr constructor. IIUC this was
because the check only looks at the changed lines and missed the extra
">" indicating this was really part of a larger template expression.

Added a condition that suppresses the check when selected brackets are
mismatching (ie. number of < and > are not equal). Added tests for these
cases.

Change-Id: I260b7826eb1f55764a8a93b3402888afa5032eed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5538411
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Glen Robertson <glenrob@chromium.org>
Commit-Queue: Glen Robertson <glenrob@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301700}
2024-05-16 01:37:47 +00:00
Arthur Sonzogni
62e877adbf Use partition_alloc PA_BUILDFLAG(...) outside PA. #cleanup
This is an automated #cleanup patch.

Migrate:
- from  BUILDFLAG (legacy chromium macro)
- to PA_BUILDFLAG (new partition_alloc macro)

The first is going to be removed in favor of the second.

The previous patch modified every occurrences inside partition_alloc,
this one does the same, but outside of partition_alloc.

Follow-ups will:
- Update dawn.
- Update pdfium.

Bug: chromium:1508847
Change-Id: Icc3fa34ee376e5ae866e9d456c363cb4180d4a49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5490530
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1294381}
2024-04-30 16:09:43 +00:00
Alison Gale
d6b25fee68 Add presubmit to ensure only updated bug IDs are added to the codebase
I'm migrating all TODOs referencing bug IDs to the new issue tracker
ID numbers. To avoid backsliding, I'm adding this presubmit. This LSC
is documented at go/crbug-todo-migration.

Bug: 321899722
Change-Id: Ib2fdd299796bf89124d5419cf0908c7cf380fe29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5455308
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288678}
2024-04-17 13:59:04 +00:00
Ted Choc
f486e3fc74 Migrate getLastUsedRegularProfile from Profile -> ProfileManager.
Deprecated profile methods will be removed in a subsequent CL
to avoid late breaking conflicts.

Bug: 40254448
Change-Id: I6dddb9f9b78abe58a4f8c3f65b6dd7c1b7489595
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5304420
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Theresa Sullivan <twellington@chromium.org>
Commit-Queue: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1262058}
2024-02-17 05:37:03 +00:00
Andrew Grieve
685060f9dd Android: Remove support for junit3 tests
We moved to junit4 long ago.

Bug: 40693265
Change-Id: I3be7bd0681fdb55bc95d63dafebedfcd7e646d33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5288616
Reviewed-by: Haiyang Pan <hypan@google.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1260024}
2024-02-13 20:35:25 +00:00
Rainhard Findling
3cde3ef0b3 [presubmit] ICU syntax check: allow =2 and =3 cases
Manually add =2 and =3 numeric cases to the allowed syntax of the ICU
syntax presubmit check.

While a generic solution that recognizes all possible numeric cases
automatically would also fix this for the =4 case and above, this
solution here is simpler and seem sufficient, given that the vast
majority of strings use up to =3 (at this point there is a single =4
case in the codebase, and none above).

Fixed: 41495103
Change-Id: Ib945c640f94d139d90a0d06e67dff5099b50d788
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5237281
Reviewed-by: Dominic Battre <battre@chromium.org>
Reviewed-by: Nicolas MacBeth <nicolasmacbeth@google.com>
Reviewed-by: Rainhard Findling <rainhard@chromium.org>
Commit-Queue: Rainhard Findling <rainhard@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256306}
2024-02-05 18:40:32 +00:00
Peter Kasting
134e9e5c7b Lock down access to LayoutSuperclass<>() and verify protections.
It's not possible to enforce at compile-time that LayoutSuperclass<>()
is only called while a layout is being processed, so enforce that at
runtime instead, and verify that enforcement with a death test.

This also adds nocompile tests that verify the PassKey protections on
Layout().

As a result, it should be impossible to improperly Layout() directly
from tests, so the presubmits blocking that are removed.

Bug: 1521108
Change-Id: I8f7653c7bdcbbebe5e042310028b3f7de691614f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5259737
Reviewed-by: Dominic Battre <battre@chromium.org>
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1255197}
2024-02-01 19:23:39 +00:00
Andrew Grieve
d3a35d8b6e Revert "Remove outdated TAG length presubmit error"
This reverts commit 77e3d6fa3d.

Reason for revert: It's still useful to have a limit here.

Original change's description:
> Remove outdated TAG length presubmit error
>
> The tag length limitation only applies to API <= 25, and Chrome has a min
> API of 26:
> https://source.chromium.org/chromium/chromium/src/+/main:build/config/android/config.gni;l=70?q=min_sdk_version%20lang:gn&ss=chromium.
>
> Change-Id: I5c75e3db16f068d8e5c61f1611b927e81b43db68
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5147980
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Commit-Queue: Geoff Huang <geoffhuang@google.com>
> Auto-Submit: Geoff Huang <geoffhuang@google.com>
> Cr-Commit-Position: refs/heads/main@{#1240847}

Change-Id: I3de662e88047ebf6e24c7971e02cf6c481cff4f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5160549
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1242138}
2024-01-02 21:24:38 +00:00
Geoff Huang
77e3d6fa3d Remove outdated TAG length presubmit error
The tag length limitation only applies to API <= 25, and Chrome has a min
API of 26:
https://source.chromium.org/chromium/chromium/src/+/main:build/config/android/config.gni;l=70?q=min_sdk_version%20lang:gn&ss=chromium.

Change-Id: I5c75e3db16f068d8e5c61f1611b927e81b43db68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5147980
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Geoff Huang <geoffhuang@google.com>
Auto-Submit: Geoff Huang <geoffhuang@google.com>
Cr-Commit-Position: refs/heads/main@{#1240847}
2023-12-25 06:27:38 +00:00
Daniel Cheng
99f90e6b0c Revert "PRESUBMIT.py type annotation for MockFile {Old,New}Content"
This reverts commit a4d9b63b54.

Reason for revert: Breaks some presubmit builders; see crbug.com/1505878

Original change's description:
> PRESUBMIT.py type annotation for MockFile {Old,New}Content
>
> Using strings instead of a Sequence[str] is a common error. This
> prevented a bug in to be caught previously:
> https://chromium-review.googlesource.com/c/chromium/src/+/5012813
>
> Apparently, the same error was made ~50 times.
>
> Bug: chromium:1395297
> Change-Id: I7b580a57522742b0dbbbdbfc274aa3b8d63af789
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017939
> Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Daniel Cheng <dcheng@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1230109}

Bug: chromium:1395297
Change-Id: Ieb9be89929908725944aefb247a9b418af0e0e8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5067065
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1230256}
2023-11-28 22:54:40 +00:00
Arthur Sonzogni
a4d9b63b54 PRESUBMIT.py type annotation for MockFile {Old,New}Content
Using strings instead of a Sequence[str] is a common error. This
prevented a bug in to be caught previously:
https://chromium-review.googlesource.com/c/chromium/src/+/5012813

Apparently, the same error was made ~50 times.

Bug: chromium:1395297
Change-Id: I7b580a57522742b0dbbbdbfc274aa3b8d63af789
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017939
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1230109}
2023-11-28 20:30:26 +00:00
Arthur Sonzogni
9eafd22a23 Fix CheckDanglingUntriaged in PRESUBMIT.py
Due to not having type check in python, both the implementation and the
test were assuming `OldContents()` and `NewContents()` to be string.
They are list of strings instead.

The function `count(str)` being defined on both, it was passing locally,
when I was using DanglingUntriaged on its own line.

Bug: chromium:1395297
Change-Id: I2b20e92e2dfd0054bb4b2c3630f35af20661bbdc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5012813
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1222807}
2023-11-10 08:50:39 +00:00
Jan Keitel
77be75245a Add a presubmit check for non-inlined constexpr definitions in headers.
Non-inlined constexpr variable definitions in a header lead every file
that includes this header to create a separate copy of the constant.
There appears to be no upside, but potential downsides (larger binary
size, differing memory addresses when one expect them to be equal)
from that behavior.

This CL adds a PRESUBMIT warning for changed or modified non-inline
constexpr variable definitions in headers. The check excludes
a) definitions in .cc files (which should hopefully not be included)
b) static constexpr member definitions inside structs and classes,
   as these are implicitly inline.

Relevant links:
- https://groups.google.com/a/chromium.org/g/cxx/c/hmyGFD80ocE
  (includes a discussion of adding this check)
- https://abseil.io/tips/168

Trial CL to just replace all non-inline constexpr seems to make bots
happy (apart from presubmit checks):
https://chromium-review.googlesource.com/c/chromium/src/+/4708325

Bug: 1467190
Change-Id: I187cecc0cb0676ee0e5950a6791f15cba96cb19c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4710609
Reviewed-by: Dominic Battre <battre@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209049}
2023-10-12 20:40:49 +00:00
Sam Maier
b8a66a00b1 Fixing @Mock Presubmit with new Java formatting
Bug: 1490300
Change-Id: I823ea1cecb4e0da0b92c07ff896453f970f229c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4918411
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1207619}
2023-10-10 13:50:55 +00:00
Arthur Sonzogni
7109bd363b Reland "PRESUBMIT: Warn against adding new dangling pointers."
This is a reland of commit 8228ad6aef

What happens in the reland:
---------------------------

I added an early return when `input_api.nodiff` is true. This disable
the check completely.

Performance evaluation:
-----------------------

Because the original presubmit check was reverted due to the performance
cost when running `git cl presubmit --all`, it comes the question of the
performance cost during normal `git cl presubmit`.

I am evaluating the cost to be in the range: [-0.178%, -1.04%].
This is the 95 confidence interval using a t-test.

This was tested on a very large patch modifying 535 files. The data was:

Without With
------- ----
91.1s   91.5s
91.6s   91.8s
91.6s   92.1s
90.9s   92.0s
91.3s   91.9s

Original change's description:
> PRESUBMIT: Warn against adding new dangling pointers.
>
> The DanglingPointerDetector is enabled on the CQ. It means we are now
> blocking new dangling pointers and can detect regressions.
>
> This blocks ~10 patches per day. The error message contains links toward
> the documentation and a guide to fix dangling pointers:
> - docs/dangling_ptr.md
> - docs/dangling_ptr_guide.md
>
> This is enough for most developers to fix them. However, it happens some
> are simply adding new `DanglingUntriaged` occurrences. Most are
> copy-pasting nearby code thinking this is the correct way to do.
>
> This patch adds a PRESUBMIT warning developers.
>
> Change-Id: I05d09e3f988f65b461a040c76a6ba2904073864b
> Bug: chromium:1395297
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4853628
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1200144}

Bug: chromium:1395297
Change-Id: I0a8305383eda3c3b50c0f433bd6751cf19069584
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4907727
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1204558}
2023-10-03 10:34:42 +00:00
Arthur Sonzogni
2769a375d0 Revert "PRESUBMIT: Warn against adding new dangling pointers."
This reverts commit 8228ad6aef.

Reason for revert: https://crbug.com/1486612

The check takes too long when running `git cl presubmit --all`. 
I will reland it later with a different strategy.

Original change's description:
> PRESUBMIT: Warn against adding new dangling pointers.
>
> The DanglingPointerDetector is enabled on the CQ. It means we are now
> blocking new dangling pointers and can detect regressions.
>
> This blocks ~10 patches per day. The error message contains links toward
> the documentation and a guide to fix dangling pointers:
> - docs/dangling_ptr.md
> - docs/dangling_ptr_guide.md
>
> This is enough for most developers to fix them. However, it happens some
> are simply adding new `DanglingUntriaged` occurrences. Most are
> copy-pasting nearby code thinking this is the correct way to do.
>
> This patch adds a PRESUBMIT warning developers.
>
> Change-Id: I05d09e3f988f65b461a040c76a6ba2904073864b
> Bug: chromium:1395297
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4853628
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1200144}

Bug: chromium:1395297
Change-Id: I5c6ade4930e0383dcb8f139ca80451ab05930d11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4889652
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1201647}
2023-09-26 16:45:22 +00:00
Kalvin Lee
84ad17ab78 MiraclePtr: Adjust presubmit denylist and docs
This CL partially opens up renderer code to MiraclePtr usage. We
now only disallow several specific directories.

Bug: 1444624
Change-Id: I3b2d1f77db7fe3d1ccb948530c41cef64cb6a82f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4885755
Commit-Queue: Kalvin Lee <kdlee@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1200912}
2023-09-25 11:14:41 +00:00
Arthur Sonzogni
8228ad6aef PRESUBMIT: Warn against adding new dangling pointers.
The DanglingPointerDetector is enabled on the CQ. It means we are now
blocking new dangling pointers and can detect regressions.

This blocks ~10 patches per day. The error message contains links toward
the documentation and a guide to fix dangling pointers:
- docs/dangling_ptr.md
- docs/dangling_ptr_guide.md

This is enough for most developers to fix them. However, it happens some
are simply adding new `DanglingUntriaged` occurrences. Most are
copy-pasting nearby code thinking this is the correct way to do.

This patch adds a PRESUBMIT warning developers.

Change-Id: I05d09e3f988f65b461a040c76a6ba2904073864b
Bug: chromium:1395297
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4853628
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1200144}
2023-09-22 11:57:23 +00:00
mikt
9337567cd4 [MO] Define memory safety check control macro
- Add `enum class base::internal::MemorySafetyCheck` - each enum item
  represents memory safety check, implemented in PA and UaF detector.
- Add macro `ADVANCED_MEMORY_SAFETY_CHECKS()` - when used inside class
  declaration, it specifies a set of checks
  `base::internal::kAdvancedMemorySafetyChecks` enforced over that
  object type.
  - This macro will be used as a part of MiracleObject project,
    see the bug for the details.
- Add following constexpr functions to determine enabled safety checks for type
  `T`.
  - `base::internal::get_memory_safety_checks<T>`
  - `base::internal::is_memory_safety_checked<T, Checks>`

Bug: 1462223
Change-Id: I611a825d260705ed110932f08cbe756ab44ea7e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4664244
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Mikihito Matsuura <mikt@google.com>
Cr-Commit-Position: refs/heads/main@{#1194241}
2023-09-08 18:38:17 +00:00
Aaron Leventhal
267119f5b4 Scale back presubmit warnings on missing Android a11y tests
Tweak presubmit warnings that are intended to encourage
developers to add Android dump tree/event test expectations:
* No warnings when other platform expectations are not added -- it's
  common to only care about the Blink output, or to not even care
  about the output but just test for crashes.
* No warnings on modifications or deletes -- there isn't a high
  value for these, and it makes the other new tweaks more
  difficult.

This should significantly reduce noise on presubmits and thus
developer friction. It will also reduce times when developers
not as familiar with our requirements will go overboard in
producing platform expectations files.

R=mschillaci@chromium.org

Bug: none
Change-Id: I9557cc38e920c5dab25490d5d81942bd3c187a3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4794290
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Mark Schillaci <mschillaci@google.com>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185423}
2023-08-18 22:45:34 +00:00
Mark Schillaci
8ef0d871ef Add @interface's to @Batch/DoNotBatch ignore list
The PRESUBMIT checks look for @Batch or @DoNotBatch on test files and
give warnings if they are not present. These should not include
simple @interface's like DisabledTest.java or EnormousTest.java etc.

AX-Relnotes: N/A
Bug: N/A
Change-Id: I3a3278925a6d78f548e4154aca52f12e600f37b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4697253
Commit-Queue: Mark Schillaci <mschillaci@google.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: James Shen <zhiyuans@google.com>
Cr-Commit-Position: refs/heads/main@{#1172010}
2023-07-18 22:07:59 +00:00
Andrew Grieve
d27620b65a Fix presubmits sometimes hanging on print_python_deps.py
This was happening for me locally. Ctrl-C showed:
  Traceback (most recent call last):
    File "build/print_python_deps.py", line 186, in <module>
      sys.exit(main())
    File "build/print_python_deps.py", line 182, in main
      out.write(prefix + path.replace('\\', '/') + '\n')
  BrokenPipeError: [Errno 32] Broken pipe

Which means the process was blocked waiting for something to read its
output.

Bug: None
Change-Id: Ibcb45a6d8bf3af882fab3f0c3b0b607277817eb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4673673
Reviewed-by: Peter Wen <wnwen@chromium.org>
Commit-Queue: Peter Wen <wnwen@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1169982}
2023-07-13 16:35:07 +00:00
Andrew Williams
c9f69b4831 Update UNIT_TEST presubmit check to match more cases
Updates the UNIT_TEST presubmit check to do more robust checking
for the UNIT_TEST #define used in source files. Specifically,
the check will now look for cases such as `#if defined(UNIT_TEST)`.

Also, remove UNIT_TEST ifdef blocks from one .cc file that was
using them.

Bug: None
Change-Id: I541d3d6de139f59a32285962afd9035ae99d2706
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4672065
Commit-Queue: Andrew Williams <awillia@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1168134}
2023-07-10 16:07:36 +00:00
Andrew Grieve
40f451d2e9 PRESUBMIT.py: Make // IN-TEST work for .java files
Bug: None
Change-Id: Ibf015f85fbf80c7e8e4060fff361d2e60358a52f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4661685
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1166720}
2023-07-06 19:46:51 +00:00
Thiago Perrotta
099034f664 Chrome for Testing: Update in-app strings from Chromium to CfT
Add <if> conditionals to chromium_strings.grd to replace the most
prominent strings in the UI:

- Global menu bar
- 3-dot menu
- View site information
- Settings > Default browser
- Settings > About

As a trade-off, we choose this approach over creating
a new GRD file for CfT as it would be costly to maintain otherwise,
in spite of the considerations in b/1110882.

CfT strings should be identical to Chromium strings, with the exception
of the product name, which is replaced from "Chromium" with "Chromium
for Testing" as per
https://goo.gle/chrome-for-testing#bookmark=id.n1rat320av91

Bug: 1428061
Change-Id: I7cb5afe0d619551daea3204b9611854d36f5af98
Tested: `autoninja -C out/Default chrome/app:chromium_strings components/strings:components_chromium_strings chrome`
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4582551
Reviewed-by: Jens Mueller <muellerj@google.com>
Commit-Queue: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1153347}
2023-06-05 18:10:20 +00:00
Jens Mueller
054652c1cb Add presubmit check for correct sha1 format in .png.sha1 files.
Benmason@ explained that a recent submission of a png file as png.sha1
file resulted in all images on that day not to be uploaded to TC.

2nd attempt after https://crrev.com/c/4374003 was reverted due to
"Evaluation of CheckStrings failed: Access outside the repository root is denied."

This is now using input_api.AffectedFiles().NewContents instead of
opening the file directly.

Bug: 1428712
Change-Id: Ia1bcb5b132f5d92ce7378a986be74b9958175680
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4432832
Reviewed-by: Ben Mason <benmason@chromium.org>
Reviewed-by: Dominic Battre <battre@chromium.org>
Commit-Queue: Ben Mason <benmason@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1142068}
2023-05-10 15:12:30 +00:00
Vincent Boisselle
861f11db51 Revert "Add presubmit check for correct sha1 format in .png.sha1 files."
This reverts commit 069d82c9d8.

Reason for revert: cause failure in strings presubmit tests when updating grd strings, example: http://crrev.com/c/4377359

Original change's description:
> Add presubmit check for correct sha1 format in .png.sha1 files.
>
> Benmason@ explained that a recent submission of a png file as png.sha1
> file resulted in all images on that day not to be uploaded to TC.
>
> Change-Id: Iea7632de1ae4fd644bb4bce7f1fc907c3254459b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4374003
> Reviewed-by: Dominic Battré <battre@chromium.org>
> Reviewed-by: Ben Mason <benmason@chromium.org>
> Commit-Queue: Jens Mueller <muellerj@google.com>
> Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1123014}

Change-Id: Icc0c43bbd82ed16d6370b139242f2f632449a8ee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1428712
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4378561
Reviewed-by: Ernesto Izquierdo Clua <eic@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Vincent Boisselle <vincb@google.com>
Commit-Queue: Vincent Boisselle <vincb@google.com>
Cr-Commit-Position: refs/heads/main@{#1123295}
2023-03-28 21:46:38 +00:00
Mohamed Heikal
3d7a94ce2b Migrate android.support.test to androidx.test (the rest)
The java changes should be a noop since we automatically do this rewrite
in compile_java.py. Also replace
//third_party/android_support_test_runner targets with
//third_party/androidx ones.
Additionally fix non-java files eg: docs, presubmits, scripts

This affects files outside //android_webview, //chrome, //components and
//weblayer which are covered by other cls.

Bug: 1428304
Change-Id: I2906b7530127983e6110e9ab5773843df0dd3ba8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4375857
Reviewed-by: Peter Wen <wnwen@chromium.org>
Owners-Override: Peter Wen <wnwen@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1123104}
2023-03-28 16:55:24 +00:00
Jens Mueller
069d82c9d8 Add presubmit check for correct sha1 format in .png.sha1 files.
Benmason@ explained that a recent submission of a png file as png.sha1
file resulted in all images on that day not to be uploaded to TC.

Change-Id: Iea7632de1ae4fd644bb4bce7f1fc907c3254459b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4374003
Reviewed-by: Dominic Battré <battre@chromium.org>
Reviewed-by: Ben Mason <benmason@chromium.org>
Commit-Queue: Jens Mueller <muellerj@google.com>
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1123014}
2023-03-28 14:42:02 +00:00
Mike Dougherty
4d1050b713 Update iOS JavaScript presubmit to support moved files
The presubmit currently prevents moving a JavaScript file to a new
location. This CL allows such CLs by using a warning instead of an error
if a script of the same name was deleted and added in the examined diff.

Change-Id: I0c5761b5f774bea8a6733e78c2ef0a31d47eab9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4335695
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1117004}
2023-03-14 15:59:53 +00:00
Min Qin
bc44383cb2 Add PRESUBMIT rule for ban VectorDrawableCompat import in Java
VectorDrawableCompat Could take a long time to complete, so adding
a ban to let users use the alternative class with trace events.

BUG=b/242038130

Change-Id: I174c918e7dd5fef15a551eace33d1bdfb3d203e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4266131
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1108408}
2023-02-22 17:25:26 +00:00
Kevin McNee
1746306427 Remove MPArch triage rotation presubmit
We are winding down the triage rotation, so the associated presubmit
script can be removed.

Bug: 1190019
Change-Id: If6226bae54a7bfc71df95211d6c00f12db10dd6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4228276
Auto-Submit: Kevin McNee <mcnee@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1103922}
2023-02-10 17:49:18 +00:00
Sven Zheng
76a79ea364 PRESUBMIT: Add crosapi need browser test check
When a new crosapi mojom file being added, we expect there should
also be a browser test being added.

This is a non-blocker check and only happens during git cl upload.
See my local test:

:~/chromium/src$ git diff HEAD~1
diff --git a/chromeos/crosapi/mojom/newfile.mojom b/chromeos/crosapi/mojom/newfile.mojom
new file mode 100644
index 0000000000000..fa1237e46e92b
--- /dev/null
+++ b/chromeos/crosapi/mojom/newfile.mojom
@@ -0,0 +1,4 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
:~/chromium/src$ git cl upload
Running Python 3 presubmit upload checks ...
** Presubmit Warnings: 1 **
You are adding a new crosapi, but there is no file ends with browsertest.cc file being added. It is important to add crosapi browser test coverage to avoid version skew issues.
Check //docs/lacros/test_instructions.md for more information.

Presubmit checks took 2.5s to calculate.
There were Python 3 presubmit warnings. Are you sure you wish to continue? (y/N):

Bug: 1402823
Change-Id: Ibcac5f90fb7332cf7199e04a8eab48fda3ac5eb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4118248
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Commit-Queue: Sven Zheng <svenzheng@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1086084}
2022-12-21 21:25:24 +00:00
Bruce Dawson
55776c49a7 Improve messages when .grd entries are modified
It can be helpful to distinguish between modified and added .grd
entries. This came up recently when trying to fix the indentation in a
.grd file and these more specific messages _might_ have helped.

Typical messages will look like this:
** Presubmit ERRORS: 1 **
You are modifying UI strings or their meanings.
To ensure the best translations, take screenshots of the relevant UI (https://g.co/chrome/translation) and add these files to your changelist:
  chromeos\chromeos_strings_grd\IDS_SCANNING_APP_SCAN_BUTTON_TEXT.png.sha1

Actually fixing the indentation will be tried in a follow-up.

Bug: 1394970
Change-Id: I60fee3086a9826ef2f233c681164e5b309a6eec6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4081196
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1081514}
2022-12-09 17:23:47 +00:00