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

Issue 9288045: PRESUBMIT check for JavaScript style errors (Closed)

Created:
8 years, 11 months ago by Tyler Breisacher (Chromium)
Modified:
8 years, 9 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

PRESUBMIT check for JavaScript style errors See https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/97b5dc28d9e5109b/a5bd070bb7f0a4b9 BUG=none TEST=modify any .js file; `git commit` it; run `git cl presubmit`; look at the errors Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=124007

Patch Set 1 #

Patch Set 2 : only check certain folders #

Patch Set 3 : check for getElementById() used instead of $() #

Patch Set 4 : ignore two more rules #

Patch Set 5 : Just 'getElementById', drop the 'document.' -- it's cleaner that way #

Total comments: 1

Patch Set 6 : add a check for |const| #

Patch Set 7 : alphabetize imports #

Total comments: 14

Patch Set 8 : fixes #

Total comments: 1

Patch Set 9 : input_api.os_path #

Total comments: 6

Patch Set 10 : nits #

Total comments: 32

Patch Set 11 : fixes from Dan #

Total comments: 17

Patch Set 12 : fixes from maruel #

Patch Set 13 : reset src/PRESUBMIT.py correctly #

Total comments: 1

Patch Set 14 : use endswith instead of regex #

Total comments: 9

Patch Set 15 : few more things #

Patch Set 16 : take out const check #

Patch Set 17 : extract js_checker into a module (following Dan's lead) #

Patch Set 18 : rebase #

Total comments: 1

Patch Set 19 : exclude options_bundle.js #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -1 line) Patch
M chrome/browser/resources/PRESUBMIT.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -1 line 0 comments Download
A chrome/browser/resources/web_dev_style/js_checker.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +123 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
Dan Beam
have you actually run this to see how much of our code would be even ...
8 years, 10 months ago (2012-01-31 02:11:04 UTC) #1
Tyler Breisacher (Chromium)
The linter actually throws runtime errors for the following files: chrome/browser/resources/options[2]/chromeos/internet_detail.js -- we're using 'default' ...
8 years, 10 months ago (2012-01-31 19:18:49 UTC) #2
Dan Beam
I greatly favor 2 as well. The reason I ask is that I don't want ...
8 years, 10 months ago (2012-01-31 21:25:31 UTC) #3
Tyler Breisacher (Chromium)
From skimming through the errors in various files, it looks like most of the changes ...
8 years, 10 months ago (2012-02-01 19:04:48 UTC) #4
Tyler Breisacher (Chromium)
I wanted to get a glimpse of what life would be like under the oppressive ...
8 years, 10 months ago (2012-02-03 02:14:28 UTC) #5
Dan Beam
https://chromiumcodereview.appspot.com/9288045/diff/8002/PRESUBMIT.py File PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/8002/PRESUBMIT.py#newcode311 PRESUBMIT.py:311: results.extend(_CheckJavaScriptStyle(input_api, output_api)) Damn, I guess I should be doing ...
8 years, 10 months ago (2012-02-03 03:09:13 UTC) #6
Tyler Breisacher (Chromium)
8 years, 10 months ago (2012-02-03 17:53:22 UTC) #7
Tyler Breisacher (Chromium)
maruel: Dan said you would probably be a good person to review this? I thought ...
8 years, 10 months ago (2012-02-06 20:13:53 UTC) #8
M-A Ruel
Sorry I missed it. http://codereview.chromium.org/9288045/diff/3006/PRESUBMIT.py File PRESUBMIT.py (right): http://codereview.chromium.org/9288045/diff/3006/PRESUBMIT.py#newcode16 PRESUBMIT.py:16: import re This import was ...
8 years, 10 months ago (2012-02-06 20:29:27 UTC) #9
Tyler Breisacher (Chromium)
http://codereview.chromium.org/9288045/diff/3006/PRESUBMIT.py File PRESUBMIT.py (right): http://codereview.chromium.org/9288045/diff/3006/PRESUBMIT.py#newcode16 PRESUBMIT.py:16: import re On 2012/02/06 20:29:27, Marc-Antoine Ruel wrote: > ...
8 years, 10 months ago (2012-02-06 22:00:11 UTC) #10
M-A Ruel
lgtm with 2 remaining nits. http://codereview.chromium.org/9288045/diff/3006/PRESUBMIT.py File PRESUBMIT.py (right): http://codereview.chromium.org/9288045/diff/3006/PRESUBMIT.py#newcode16 PRESUBMIT.py:16: import re On 2012/02/06 ...
8 years, 10 months ago (2012-02-07 00:34:09 UTC) #11
Tyler Breisacher (Chromium)
Sorry, two more questions: 1. Should the closure_linter library itself live in src/third_party, or in ...
8 years, 10 months ago (2012-02-07 01:15:59 UTC) #12
M-A Ruel
On 2012/02/07 01:15:59, Tyler Breisacher wrote: > Sorry, two more questions: > > 1. Should ...
8 years, 10 months ago (2012-02-07 01:17:13 UTC) #13
Dan Beam
https://chromiumcodereview.appspot.com/9288045/diff/18002/PRESUBMIT.py File PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/18002/PRESUBMIT.py#newcode5 PRESUBMIT.py:5: """Top-level presubmit script for Chromium. This check should probably ...
8 years, 10 months ago (2012-02-07 09:08:00 UTC) #14
Dan Beam
You also probably want to add tests and get OWNERS approval from jhawkins or csilv ...
8 years, 10 months ago (2012-02-07 09:08:54 UTC) #15
M-A Ruel
https://chromiumcodereview.appspot.com/9288045/diff/18002/PRESUBMIT.py File PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/18002/PRESUBMIT.py#newcode32 PRESUBMIT.py:32: import closure_linter.common.errorhandler On 2012/02/07 09:08:00, Dan Beam wrote: > ...
8 years, 10 months ago (2012-02-07 14:16:04 UTC) #16
Tyler Breisacher (Chromium)
https://chromiumcodereview.appspot.com/9288045/diff/18002/PRESUBMIT.py File PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/18002/PRESUBMIT.py#newcode5 PRESUBMIT.py:5: """Top-level presubmit script for Chromium. On 2012/02/07 09:08:00, Dan ...
8 years, 10 months ago (2012-02-08 02:49:28 UTC) #17
M-A Ruel
https://chromiumcodereview.appspot.com/9288045/diff/23002/PRESUBMIT.py File PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/23002/PRESUBMIT.py#newcode9 PRESUBMIT.py:9: """ Let's remove changes to this file from this ...
8 years, 10 months ago (2012-02-08 14:30:39 UTC) #18
Tyler Breisacher (Chromium)
https://chromiumcodereview.appspot.com/9288045/diff/23002/PRESUBMIT.py File PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/23002/PRESUBMIT.py#newcode9 PRESUBMIT.py:9: """ On 2012/02/08 14:30:39, Marc-Antoine Ruel wrote: > Let's ...
8 years, 10 months ago (2012-02-08 18:43:41 UTC) #19
M-A Ruel
lgtm https://chromiumcodereview.appspot.com/9288045/diff/23002/chrome/browser/resources/PRESUBMIT.py File chrome/browser/resources/PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/23002/chrome/browser/resources/PRESUBMIT.py#newcode61 chrome/browser/resources/PRESUBMIT.py:61: join('chrome', 'browser', 'resources', 'ntp4'), On 2012/02/08 18:43:41, Tyler ...
8 years, 10 months ago (2012-02-08 18:54:53 UTC) #20
Dan Beam
lgtm w/nits (correct me if any are against some style I don't know about, maruel@) ...
8 years, 10 months ago (2012-02-08 19:46:54 UTC) #21
M-A Ruel
https://chromiumcodereview.appspot.com/9288045/diff/23004/chrome/browser/resources/PRESUBMIT.py File chrome/browser/resources/PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/23004/chrome/browser/resources/PRESUBMIT.py#newcode25 chrome/browser/resources/PRESUBMIT.py:25: self._errors = [] On 2012/02/08 19:46:54, Dan Beam wrote: ...
8 years, 10 months ago (2012-02-08 19:57:24 UTC) #22
Tyler Breisacher (Chromium)
https://chromiumcodereview.appspot.com/9288045/diff/23004/chrome/browser/resources/PRESUBMIT.py File chrome/browser/resources/PRESUBMIT.py (right): https://chromiumcodereview.appspot.com/9288045/diff/23004/chrome/browser/resources/PRESUBMIT.py#newcode19 chrome/browser/resources/PRESUBMIT.py:19: import closure_linter.errors On 2012/02/08 19:46:54, Dan Beam wrote: > ...
8 years, 10 months ago (2012-02-08 20:03:55 UTC) #23
Tyler Breisacher (Chromium)
From http://code.google.com/p/chromium/issues/detail?id=80149#c7 it sounds like const won't be optimized any *more* than var, but it's ...
8 years, 10 months ago (2012-02-08 20:18:37 UTC) #24
M-A Ruel
On 2012/02/08 20:18:37, Tyler Breisacher wrote: > From http://code.google.com/p/chromium/issues/detail?id=80149#c7 it sounds like > const won't ...
8 years, 10 months ago (2012-02-08 20:27:42 UTC) #25
Tyler Breisacher (Chromium)
739.1 KB
8 years, 10 months ago (2012-02-08 21:34:41 UTC) #26
Dan Beam
> The VM enforces it for "private" members, namely __foo. self._errors is the right format ...
8 years, 10 months ago (2012-02-08 22:00:00 UTC) #27
M-A Ruel
On 2012/02/08 21:34:41, Tyler Breisacher wrote: > 739.1 KB With or without test and doc? ...
8 years, 10 months ago (2012-02-09 00:35:11 UTC) #28
Tyler Breisacher (Chromium)
On 2012/02/09 00:35:11, Marc-Antoine Ruel wrote: > On 2012/02/08 21:34:41, Tyler Breisacher wrote: > > ...
8 years, 10 months ago (2012-02-09 00:39:58 UTC) #29
M-A Ruel
On 2012/02/09 00:39:58, Tyler Breisacher wrote: > On 2012/02/09 00:35:11, Marc-Antoine Ruel wrote: > > ...
8 years, 10 months ago (2012-02-09 01:34:39 UTC) #30
Tyler Breisacher (Chromium)
jhawkins: Need an lg on this from a resources/ OWNER. (Probably want to land https://chromiumcodereview.appspot.com/9316086/ ...
8 years, 10 months ago (2012-02-09 01:58:31 UTC) #31
James Hawkins
On 2012/02/09 01:58:31, Tyler Breisacher wrote: > jhawkins: Need an lg on this from a ...
8 years, 10 months ago (2012-02-09 02:02:18 UTC) #32
Tyler Breisacher (Chromium)
> Ok, skip the directory testdata, add a README.chromium and add it to > third_party. ...
8 years, 10 months ago (2012-02-14 19:14:15 UTC) #33
Tyler Breisacher (Chromium)
Nevermind, just saw what Dan is doing with sys.path.insert in the other CL. Looks like ...
8 years, 10 months ago (2012-02-15 00:14:10 UTC) #34
Tyler Breisacher (Chromium)
On 2012/02/15 00:14:10, Tyler Breisacher wrote: > Nevermind, just saw what Dan is doing with ...
8 years, 10 months ago (2012-02-15 19:37:43 UTC) #35
Dan Beam
lgtm (because looks awesome to me [latm] doesn't trigger the magical green box)
8 years, 10 months ago (2012-02-15 19:42:47 UTC) #36
M-A Ruel
lgtm https://chromiumcodereview.appspot.com/9288045/diff/20004/chrome/browser/resources/web_dev_style/js_checker.py File chrome/browser/resources/web_dev_style/js_checker.py (right): https://chromiumcodereview.appspot.com/9288045/diff/20004/chrome/browser/resources/web_dev_style/js_checker.py#newcode115 chrome/browser/resources/web_dev_style/js_checker.py:115: remove empty line.
8 years, 10 months ago (2012-02-15 19:51:05 UTC) #37
Tyler Breisacher (Chromium)
Sorry, one more question. Closure-linter depends on python-gflags (I didn't notice because I had used ...
8 years, 10 months ago (2012-02-15 22:42:59 UTC) #38
Marc-Antoine Ruel (Google)
8 years, 10 months ago (2012-02-15 22:47:56 UTC) #39
On 2012/02/15 22:42:59, Tyler Breisacher wrote:
> Sorry, one more question. Closure-linter depends on python-gflags (I didn't
> notice because I had used easy_install before, so I had gflags in
dist-packages)
> so I guess we either need everyone to install python-gflags (via easy_install
or
> something like that) or we need to also add python-gflags to our source tree.
> It's at http://code.google.com/p/python-gflags/ and weighs in at 278KB
including
> tests. So I would guess adding it to the source tree makes the most sense?

Don't expect people to have any specific python package.

Commit it without the tests.

Powered by Google App Engine
This is Rietveld 408576698