Skip to content

Commit

Permalink
tools
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlstrom-g committed Apr 16, 2024
1 parent dbe584c commit c021381
Show file tree
Hide file tree
Showing 4,711 changed files with 626,368 additions and 187 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ norecursedirs=
testing/android
testing/gtest
testing/gmock
tools
third_party

# Ignore non-test files with test_* names that pytest would otherwise pick up.
Expand Down
1 change: 1 addition & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bazel
6 changes: 6 additions & 0 deletions tools/.style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[style]
based_on_style = pep8

# New directories should use a .style.yapf that does not include the following:
column_limit = 80
indent_width = 2
6 changes: 6 additions & 0 deletions tools/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# checkdeps.py shouldn't check include paths for files in these dirs:
skip_child_includes = [
"clang",
"traceline",
"perf/page_sets",
]
16 changes: 16 additions & 0 deletions tools/DIR_METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Metadata information for this directory.
#
# For more information on DIR_METADATA files, see:
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md
#
# For the schema of this file, see Metadata message:
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto

# These aren't actually great contact points for this directory, but
# changes in this directory are rare and most changes happen in better-owned
# subdirectories.

monorail {
component: "Build"
}
team_email: "[email protected]"
11 changes: 1 addition & 10 deletions tools/python/METADATA → tools/METADATA
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
name: "python"
description:
"Filtered subtree at tools/python."

third_party {
identifier {
type: "ChromiumVersion"
Expand All @@ -14,11 +10,6 @@ third_party {
}
identifier {
type: "UpstreamSubdir"
value: "tools/python"
}
last_upgrade_date {
year: 2023
month: 8
day: 10
value: "tools"
}
}
44 changes: 43 additions & 1 deletion tools/OWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
*
# You can add new small tools to this directory at your desire, feel free
# to owners-TBR new folders (assuming you have a regular review already,
# of course). Include an OWNERS file with at least two people for your new
# folder.
# If you're changing existing tools, have your change reviewed by the
# OWNERS of the existing tool.

set noparent
[email protected]
[email protected]
[email protected]

per-file add_header*[email protected]
per-file add_header*[email protected]

per-file [email protected]
per-file [email protected]
per-file make_gtest_filter*[email protected]
per-file make_gtest_filter*[email protected]

per-file bisect*[email protected]
per-file bisect*[email protected]

per-file [email protected]

per-file [email protected]

per-file [email protected]

per-file [email protected]

per-file [email protected]

per-file [email protected]

per-file [email protected]
per-file [email protected]
per-file [email protected]
per-file [email protected]

per-file [email protected]

per-file [email protected]
21 changes: 21 additions & 0 deletions tools/PRESUBMIT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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.

PRESUBMIT_VERSION = '2.0.0'

# This line is 'magic' in that git-cl looks for it to decide whether to
# use Python3 instead of Python2 when running the code in this file.
USE_PYTHON3 = True


def CheckPythonTests(input_api, output_api):
return input_api.RunTests(
input_api.canned_checks.GetUnitTestsInDirectory(
input_api,
output_api,
input_api.PresubmitLocalPath(),
files_to_check=[r'.+_(?:unit)?test\.py$'],
run_on_python2=False,
run_on_python3=True,
skip_shebang_check=True))
5 changes: 5 additions & 0 deletions tools/accessibility/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include_rules = [
"+content/browser/accessibility",
"+content/public/browser",
"+ui/accessibility/platform/inspect",
]
9 changes: 9 additions & 0 deletions tools/accessibility/DIR_METADATA
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Metadata information for this directory.
#
# For more information on DIR_METADATA files, see:
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/README.md
#
# For the schema of this file, see Metadata message:
# https://source.chromium.org/chromium/infra/infra/+/main:go/src/infra/tools/dirmd/proto/dir_metadata.proto

mixins: "//ui/accessibility/COMMON_METADATA"
1 change: 1 addition & 0 deletions tools/accessibility/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file://ui/accessibility/OWNERS
28 changes: 28 additions & 0 deletions tools/accessibility/codereview/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Summary
========================================
Provide an alternative workflow to Gerrit/Poly Gerrit.

Setup
========================================

Load/initialize crq.el (the Emacs front-end). Add crq.el at runtime (m-x load-file, crq.el <ret>). Load it in your .emacs otherwise (load-file "<path-to-crq.el>").

Place this directory in your path.

Usage
========================================
- Switch to your root Chrome src directory.
- from email, grab either the change id hash or issue number.
- m-x crq-review
- yank the issue number, <ret>
- read the diff. Press enter to add an in-line comment and press c-u, space to return to the diff.
- add lgtm to the overall comment (after the === comments ===) section
- c-c, c-p to publish

TODO
========================================
- check in gerrit_utils.py api additions once ready
- add api bindings for listing published comments and get into download_issue.py
- make hitting enter on a published comment (in the crq mode) reply to that comment and make the GerritParser aware of it to pass through to the right api endpoint.
- make more of the usage automated (e.g. add mode bindings for downloading, publishing, etc).
- pass through lgtm on overall comment as SetReview with label Code-Review: 1
91 changes: 91 additions & 0 deletions tools/accessibility/codereview/codereview_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
"""Parser for a comments file."""

import re

COMMENTS_STR = "=== COMMENTS ===\n"
COMMENT_SEP_STR = "=" * 72 + "\n"
DASHES_STR = "-" * 36 + "\n"
FILE_LINE_RE = re.compile(
"File (?P<name>[^\s]+)( \(snapshot (?P<snapshot>\d+)\))?")
LINE_LINE_RE = re.compile("Line (?P<number>\d+): (?P<text>.*)\n")


class Parser(object):
def __init__(self, linesiter):
self._lines = linesiter

def OnPreambleLine(self, line):
pass

def OnFinishPreamble(self):
pass

def OnOverallComment(self, comment):
pass

def OnFileComment(self, path, line, text, comment):
pass

def OnError(self, msg):
pass

def Parse(self):
self.ReadPreamble()
self.OnFinishPreamble()
self.ReadOverallComment()
self.ReadFileComments()

def ReadPreamble(self):
for line in self._lines:
if line == COMMENTS_STR:
break
self.OnPreambleLine(line)
else:
self.OnError("No COMMENTS line found")

def ReadOverallComment(self):
self.OnOverallComment(self.ReadComment())

def ReadComment(self):
ret = ""
for line in self._lines:
if line == COMMENT_SEP_STR:
break
ret += line
else:
self.OnError("No final separator line")
return ret

def ReadFileComments(self):
while self.ReadFileComment():
pass

def ReadFileComment(self):
try:
path = self.ReadFileLine()
except StopIteration:
return False
self.SkipDashes()
line, text = self.ReadLineLine()
comment = self.ReadComment()
self.OnFileComment(path, line, text, comment)
return True

def ReadFileLine(self):
line = next(self._lines)
match = FILE_LINE_RE.search(line)
if not match:
self.OnError("Invalid file line: %s" % line)
return match.group("name")

def SkipDashes(self):
line = next(self._lines)
if line != DASHES_STR:
self.OnError("Expecting dashes: %s" % line)

def ReadLineLine(self):
line = next(self._lines)
match = LINE_LINE_RE.match(line)
if not match:
self.OnError("Invalid line line: %s " % line)
return int(match.group("number")), match.group("text")
Loading

0 comments on commit c021381

Please sign in to comment.