You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This CL adds a "early terminate the field based on field value" parser mechanism to end the field as soon as the field value provides an unambiguous answer to the question we care about. This is to prevent over-extraction over certain fields (specifically, local modifications) which can either be a definitive answer (e.g. No modification) or multi-line free-form texts (which may contain unknown fields that we don't care about at this stage). This mitigates over extraction of README.chromium files like: ``` Local Modifications: None How to Uprev: Steps... ``` Where the old parser would extract "None\n\nHow to Uprev:\nSteps..." This CL also refactors single line fields to use the same early termination mechanism since single line field simply ends as soon as the line is parsed. Union[Something, None] is changed to Optional[Something] based on styleguide. Bug: b/324149233 Change-Id: I3fca80eaceb071263f8ae8730afda230fff0bbb0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5394917 Reviewed-by: Anne Redulla <aredulla@google.com> Commit-Queue: Jiewei Qian <qjw@chromium.org> |
1 year ago | |
---|---|---|
.. | ||
fields | 1 year ago | |
tests | 1 year ago | |
OWNERS | 2 years ago | |
PRESUBMIT.py | 2 years ago | |
README.md | 2 years ago | |
__init__.py | 2 years ago | |
dependency_metadata.py | 2 years ago | |
discover.py | 1 year ago | |
parse.py | 1 year ago | |
scan.py | 1 year ago | |
validate.py | 1 year ago | |
validation_result.py | 1 year ago |
README.md
Validation for Chromium's Third Party Metadata Files
This directory contains the code to validate Chromium third party metadata
files, i.e. README.chromium
files.
Prerequisites
- Have the Chromium source code checked out on disk
- Ensure you've run
gclient runhooks
on your source checkout
Run
metadata/scan.py
can be used to search for and validate all Chromium third
party metadata files within a repository. For example, if your chromium/src
checkout is at ~/my/path/to/chromium/src
, run the following command from the
root directory of depot_tools
:
vpython3 --vpython-spec=.vpython3 metadata/scan.py ~/my/path/to/chromium/src