5"""_macros package presubmit python script.
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details about the presubmit API built into gcl.
11PRESUBMIT_VERSION =
'2.0.0'
22 package_path =
'pkg/%s' % package_name
23 pubspec_path =
'%s/pubspec.yaml' % package_path
24 pubspec_changed =
any(file.LocalPath() == pubspec_path
25 for file
in input_api.change.AffectedFiles())
26 if not pubspec_changed:
28 (
'The pkg/_macros/lib dir was altered but the version of %s was '
29 'not bumped. See pkg/_macros/CONTRIBUTING.md' % package_path))
31 changelog_path =
'%s/CHANGELOG.md' % package_path
32 changelog_changed =
any(file.LocalPath() == changelog_path
33 for file
in input_api.change.AffectedFiles())
34 if not changelog_changed:
36 (
'The pkg/_macros/lib dir was altered but the CHANGELOG.md of %s '
37 'was not edited. See pkg/_macros/CONTRIBUTING.md' % package_path))
46 lib_changed =
any(file.LocalPath().startswith(
'pkg/_macros/lib')
47 for file
in input_api.AffectedFiles())
54 output_api.PresubmitError(
55 'pkg/_macros presubmit/PRESUBMIT.py failure(s):',
56 long_text=
'\n\n'.
join(errors))
def CheckChange(input_api, output_api)
def EnsurePubspecAndChangelogAltered(input_api, package_name)
SIT bool any(const Vec< 1, T > &x)
static SkString join(const CommandLineFlags::StringArray &)