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

Issue 929043002: Add a presubmit check that warns about declaring Singleton<T> in header files (Closed)

Created:
5 years, 10 months ago by Alexander Potapenko
Modified:
5 years, 10 months ago
Reviewers:
Paweł Hajdan Jr.
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a presubmit check that warns about declaring Singleton<T> in header files (except for base/memory/singleton.h) This check is copied from presubmit_canned_checks.py in depot_tools/ with an added exception for base/memory/singleton.h. The corresponding code will be removed from presubmit_canned_checks.py afterwards. BUG=349861 R=phajdan.jr@chromium.org, Committed: https://crrev.com/9b73d0393037452d13358f4e2766cb62adbdede8 Cr-Commit-Position: refs/heads/master@{#316546}

Patch Set 1 #

Patch Set 2 : Added presubmit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -0 lines) Patch
M PRESUBMIT.py View 1 2 chunks +31 lines, -0 lines 0 comments Download
M PRESUBMIT_test.py View 1 1 chunk +27 lines, -0 lines 0 comments Download
M PRESUBMIT_test_mocks.py View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
Alexander Potapenko
Paweł, can you please take a look? As noticed by M-A in https://codereview.chromium.org/924863002, there's no ...
5 years, 10 months ago (2015-02-16 13:22:32 UTC) #2
Paweł Hajdan Jr.
LGTM
5 years, 10 months ago (2015-02-16 15:18:52 UTC) #3
Alexander Potapenko
On 2015/02/16 15:18:52, Paweł Hajdan Jr. wrote: > LGTM Just noticed there are tests for ...
5 years, 10 months ago (2015-02-16 15:39:20 UTC) #4
Paweł Hajdan Jr.
On 2015/02/16 15:39:20, Alexander Potapenko wrote: > Just noticed there are tests for presubmit checks. ...
5 years, 10 months ago (2015-02-16 17:04:54 UTC) #5
Alexander Potapenko
On 2015/02/16 17:04:54, Paweł Hajdan Jr. wrote: > On 2015/02/16 15:39:20, Alexander Potapenko wrote: > ...
5 years, 10 months ago (2015-02-16 18:13:14 UTC) #7
Paweł Hajdan Jr.
LGTM
5 years, 10 months ago (2015-02-16 19:08:32 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/929043002/20001
5 years, 10 months ago (2015-02-17 09:02:41 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-17 09:26:28 UTC) #11
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/9b73d0393037452d13358f4e2766cb62adbdede8 Cr-Commit-Position: refs/heads/master@{#316546}
5 years, 10 months ago (2015-02-17 09:27:14 UTC) #12
Alexander Potapenko
5 years, 10 months ago (2015-02-17 11:17:21 UTC) #13
Message was sent while issue was closed.
A revert of this CL (patchset #2 id:20001) has been created in
https://codereview.chromium.org/934723003/ by glider@chromium.org.

The reason for reverting is: Reverting because of presubmit crashes:

Traceback (most recent call last):
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 2983, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 2969, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/usr/local/google/ssd/depot_tools/subcommand.py", line 245, in execute
    return command(parser, args[1:])
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 1614, in CMDpresubmit
    change=cl.GetChange(base_branch, None))
  File "/usr/local/google/ssd/depot_tools/git_cl.py", line 936, in RunHook
    rietveld_obj=self.RpcServer())
  File "/usr/local/google/ssd/depot_tools/presubmit_support.py", line 1396, in
DoPresubmitChecks
    results += executer.ExecPresubmitScript(presubmit_script, filename)
  File "/usr/local/google/ssd/depot_tools/presubmit_support.py", line 1313, in
ExecPresubmitScript
    result = eval(function_name + '(*__args)', context)
  File "<string>", line 1, in <module>
  File "<string>", line 1727, in CheckChangeOnCommit
  File "<string>", line 1455, in _CommonChecks
  File "<string>", line 1322, in _CheckSingletonInHeaders
  File "/usr/local/google/ssd/depot_tools/presubmit_support.py", line 472, in
ReadFile
    raise IOError('Access outside the repository root is denied.')
IOError: Access outside the repository root is denied.
.

Powered by Google App Engine
This is Rietveld 408576698