This CL introduces a new presubmit check to enforce using shared Chrome
iOS colors by requiring all new colors to be added to
ios/chrome/common/ui/colors/ and providing helpful warnings to users
when colors are modified.
Technical implementation:
- Adds CheckNewColorIntroduction presubmit check that monitors colorset
file changes
- Implements error checking for new colors added outside
ios/chrome/common/ui/colors/
- Provides warnings for modified colors
- Adds FormatMessageWithFiles helper for consistent error reporting
Critical conditions:
- Errors: New colors must be added to ios/chrome/common/ui/colors/
- Warnings: Generated for:
- New colors added to ios/chrome/common/ui/colors/ (to check for
duplicates)
- Modifications to existing colors (to ensure shared color usage)
Usage constraints:
- Affects all changes to .colorset/Contents.json files
- Full test coverage included to validate different color modification
scenarios
Change-Id: I01fc85d553be7d6e234bd4d29fc353c55bc26ba3
Fixed: 397741197
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6281073
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Benjamin Williams <bwwilliams@google.com>
Reviewed-by: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422462}
This CL adds a presubmit check trying to limit new usage of
NSUserDefaults.
Note that this check provides a WARNING message.
This check does not cover all scenarios and can produce some false
positives (in case the developer uses the pattern code to get
the content of an existing userDefault key).
Bug: none
Change-Id: Ie78b731ff5517a5c2d331494b2e76c66f630c6dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6179973
Reviewed-by: Mark Cogan <marq@chromium.org>
Commit-Queue: Federica Germinario <fedegermi@google.com>
Cr-Commit-Position: refs/heads/main@{#1411606}
This CL adds a presubmit check which checks if new changes in
unit test code can be improved by giving a warning message.
Example of lines that can be improved:
(EXPECT_TRUE or EXPECT_FALSE) +
(isEqualToString: or isEqualToData: or isEqualToArray:)
This CL also fixed the error_message string of:
_CheckHasNoChromeBrowserStateForwardDeclaration
Bug: none
Change-Id: I46a3593c7d9d41c54cdf87986895e295553e01c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5866150
Commit-Queue: Federica Germinario <fedegermi@google.com>
Reviewed-by: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1356410}
Adds a PRESUBMIT check to catch forward-declarations of
ChromeBrowserState, which (for the time being) should instead be
done with the forwarding header.
The check for this is intentionally quite narrow.
Bug: 359821340
Change-Id: I143cd68ad37ccb69a03f17014ec3819f6c2fde5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5797169
Auto-Submit: Mark Cogan <marq@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344010}
This CL changes the ios/ PRESUBMIT to warn if b/ links are used in
TODOs.
Also fixes some error messages. In the singular, inserts an 'a' for
correctness ("without a bug number" vs "without bug number"). Also now
the parentheses opened with "(expected format is" is now closed before
the final colon.
Bug: 326058403
Change-Id: I863a013120939e3fe20656b064c8d095e30b1223
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5343955
Reviewed-by: Asami Doi <asamidoi@chromium.org>
Commit-Queue: Mark Cogan <marq@chromium.org>
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Mark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1269465}
The ARC boilerplate isn't needed any more and is being removed across
the codebase. Add a presubmit to avoid getting any more committed.
The presubmit change alone landed earlier and was reverted because it
wasn't ready. Now this lands along with other related changes.
Bug: 1468376
Change-Id: I9a7fdc66ed5daa1d623e3226fdf4e9004c071d5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4727321
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1177895}
Right now, changes to //PRESUBMIT.py trigger running
//PRESUBMIT_test.py during presubmit checks.
However, this does not happen for PRESUBMITs in subdirectories, of
which there is a number with associated PRESUBMIT_test. This CL allows
running the associated PRESUBMIT_test.
Bug: 821981
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I057f4d736992795dde7dd0d329ed3773d22553dc
Reviewed-on: https://chromium-review.googlesource.com/966906
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544318}
The check is failing because it was written as if the content of the
file returned with f.NewContents() is a string. It is actually a list.
This CL fixes it.
The check never worked.
Bug: 798289
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Icfd216bbcaee78671878b65ac412b9063bd24509
Reviewed-on: https://chromium-review.googlesource.com/847372
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526452}
All TODOs in src/ios/ should follow the format TODO(crbug.com/######)
so add a PRESUBMIT.py check (and corresponding unit tests) for that.
BUG=677203
Change-Id: I360ad75c786f292d3a8ada8df519cb451c1c2828
Reviewed-on: https://chromium-review.googlesource.com/538613
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482589}