commit | 5a4b94047f0d94f66817ac6783d25b226754c03f | [log] [tgz] |
---|---|---|
author | Garrett Beaty <gbeaty@chromium.org> | Tue Mar 30 16:34:58 2021 |
committer | LUCI CQ <infra-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Mar 30 16:34:58 2021 |
tree | 71316b29fbb262768a3ec69493fa412f1e4b1e38 | |
parent | 5b780ffa6af453c680d9d209982786486c92bd2d [diff] |
Add constraints to attr_utils. Constraints will provide the ability to provide deeper and more flexible type-checking of fields on classes defined using attrs. It will no longer be necessary to specify a specific sequence or mapping type when they appear as the member type of a sequence or the key or value type of a mapping: sequence or mapping can be used as appropriate. The constraints can also be combined and nested, so for example one could enforce the keys and values of mappings that appear in a sequence have certain types. Change-Id: I628b9701f2051b12efb1a1b67a0aece8eeda08a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/build/+/2792049 Commit-Queue: Garrett Beaty <gbeaty@chromium.org> Auto-Submit: Garrett Beaty <gbeaty@chromium.org> Reviewed-by: Stephen Martinis <martiniss@chromium.org>
If you're here to make a change to ‘recipes’ (the code located in scripts/slave/recipes*
), please take a look at the README for more information pertaining to recipes.
The preferred style is PEP8 with two-space indent; that is, the Chromium Python style. Functions use lowercase_with_underscores
, with the exception of the special functions RunSteps
and RunTests
in recipes. Use yapf (git cl format --no-clang-format
) to autoformat new code.