Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Issue 1442023002: Sort "deps" and "public_deps" when running the "gn format" command. (Closed)

Created:
5 years, 1 month ago by sdefresne
Modified:
5 years, 1 month ago
Reviewers:
Dirk Pranke, scottmg
CC:
brettw, chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Sort "deps" and "public_deps" when running the "gn format" command. The "deps" and "public_deps" are sorted using the following rules: 1. relative targets (":a", "../b") sort before absolute targets ("//c"), 2. each group (relative and absolute) is sorted alphabetically. BUG=554928 Committed: https://crrev.com/354261e7dd491e88fde3b3bd3fa5ef6f1c629f00 Cr-Commit-Position: refs/heads/master@{#360042}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Use correct rules for sorting deps #

Patch Set 3 : Fix a crash if deps contains call to functions #

Patch Set 4 : Fix SplitAtFirst #

Total comments: 1

Patch Set 5 : Fix typo #

Total comments: 4

Patch Set 6 : Address comments by scottmg #

Total comments: 6

Patch Set 7 : Fix comments following suggestions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -14 lines) Patch
M tools/gn/command_format.cc View 1 2 3 4 5 6 3 chunks +9 lines, -6 lines 0 comments Download
M tools/gn/command_format_unittest.cc View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
A tools/gn/format_test_data/063.gn View 1 2 3 4 5 1 chunk +18 lines, -0 lines 0 comments Download
A tools/gn/format_test_data/063.golden View 1 2 3 4 5 1 chunk +18 lines, -0 lines 0 comments Download
A tools/gn/format_test_data/064.gn View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
A tools/gn/format_test_data/064.golden View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
A tools/gn/format_test_data/065.gn View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
A tools/gn/format_test_data/065.golden View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M tools/gn/parse_tree.h View 1 2 chunks +4 lines, -0 lines 0 comments Download
M tools/gn/parse_tree.cc View 1 2 3 5 chunks +49 lines, -8 lines 0 comments Download

Messages

Total messages: 27 (4 generated)
sdefresne
Please take a look.
5 years, 1 month ago (2015-11-13 14:13:05 UTC) #2
sdefresne
The new test fails with the following error before the patch and pass with it: ...
5 years, 1 month ago (2015-11-13 14:14:00 UTC) #3
sdefresne
Proof-of-concept application of this new formatting can be found at https://codereview.chromium.org/1439973004. I've sent the CL ...
5 years, 1 month ago (2015-11-13 16:26:55 UTC) #4
Dirk Pranke
no lgtm. the code change is fine but it produces the wrong behavior (see comment ...
5 years, 1 month ago (2015-11-13 17:31:31 UTC) #5
scottmg
It would also be worth running this on everything first and scrutinizing the diff to ...
5 years, 1 month ago (2015-11-13 18:46:00 UTC) #6
Dirk Pranke
On 2015/11/13 18:46:00, scottmg wrote: > It would also be worth running this on everything ...
5 years, 1 month ago (2015-11-13 18:48:48 UTC) #7
scottmg
On 2015/11/13 18:48:48, Dirk Pranke wrote: > On 2015/11/13 18:46:00, scottmg wrote: > > It ...
5 years, 1 month ago (2015-11-13 18:53:12 UTC) #8
scottmg
On 2015/11/13 18:53:12, scottmg wrote: > On 2015/11/13 18:48:48, Dirk Pranke wrote: > > On ...
5 years, 1 month ago (2015-11-13 18:54:01 UTC) #9
sdefresne
On 2015/11/13 at 17:31:31, dpranke wrote: > no lgtm. > > the code change is ...
5 years, 1 month ago (2015-11-14 09:08:07 UTC) #10
sdefresne
I've updated the CL to use the suggested ordering, please take another look. The dependent ...
5 years, 1 month ago (2015-11-14 11:00:54 UTC) #11
tfarina
Thanks for doing this Sylvain! I don't know how I missed that ;) I agree ...
5 years, 1 month ago (2015-11-14 12:05:29 UTC) #12
Dirk Pranke
On 2015/11/14 09:08:07, sdefresne wrote: > On 2015/11/13 at 17:31:31, dpranke wrote: > > no ...
5 years, 1 month ago (2015-11-14 16:55:14 UTC) #13
Dirk Pranke
lgtm, though scottmg should review it also. the example reformatted CL looks more-or-less correct also, ...
5 years, 1 month ago (2015-11-16 00:34:34 UTC) #14
sdefresne
On 2015/11/14 at 16:55:14, dpranke wrote: > On 2015/11/14 09:08:07, sdefresne wrote: > > On ...
5 years, 1 month ago (2015-11-16 09:39:39 UTC) #15
scottmg
A couple minor things noted in https://codereview.chromium.org/1439973004/. https://codereview.chromium.org/1442023002/diff/80001/tools/gn/parse_tree.cc File tools/gn/parse_tree.cc (right): https://codereview.chromium.org/1442023002/diff/80001/tools/gn/parse_tree.cc#newcode22 tools/gn/parse_tree.cc:22: if (!str.starts_with("\"") ...
5 years, 1 month ago (2015-11-16 17:40:08 UTC) #16
sdefresne
On 2015/11/16 at 17:40:08, scottmg wrote: > A couple minor things noted in https://codereview.chromium.org/1439973004/. > ...
5 years, 1 month ago (2015-11-16 19:49:18 UTC) #17
sdefresne
https://codereview.chromium.org/1442023002/diff/80001/tools/gn/parse_tree.cc File tools/gn/parse_tree.cc (right): https://codereview.chromium.org/1442023002/diff/80001/tools/gn/parse_tree.cc#newcode22 tools/gn/parse_tree.cc:22: if (!str.starts_with("\"") || !str.ends_with("\"")) On 2015/11/16 at 17:40:08, scottmg ...
5 years, 1 month ago (2015-11-16 19:52:06 UTC) #18
scottmg
On 2015/11/16 19:49:18, sdefresne wrote: > On 2015/11/16 at 17:40:08, scottmg wrote: > > A ...
5 years, 1 month ago (2015-11-16 19:54:34 UTC) #19
scottmg
I didn't relook at the other one for all the public_deps, but this CL lgtm ...
5 years, 1 month ago (2015-11-16 19:55:27 UTC) #20
sdefresne
Thank you for the review. https://codereview.chromium.org/1442023002/diff/100001/tools/gn/command_format.cc File tools/gn/command_format.cc (right): https://codereview.chromium.org/1442023002/diff/100001/tools/gn/command_format.cc#newcode131 tools/gn/command_format.cc:131: // Sort a list ...
5 years, 1 month ago (2015-11-16 20:48:05 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1442023002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1442023002/120001
5 years, 1 month ago (2015-11-17 09:12:02 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 1 month ago (2015-11-17 09:45:42 UTC) #26
commit-bot: I haz the power
5 years, 1 month ago (2015-11-17 09:46:26 UTC) #27
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/354261e7dd491e88fde3b3bd3fa5ef6f1c629f00
Cr-Commit-Position: refs/heads/master@{#360042}

Powered by Google App Engine
This is Rietveld 408576698