Commit Graph

2 Commits

Author SHA1 Message Date
Michael Bridgen 05832c5fd4 Give new and lacking files a copyright notice
In general a copyright notice takes the form:

    Copyright year name

.. where the year is the year of first publication, to let people know
from when the copyright applies. It's fairly common in software to
affix additional years in which the software was modified and
released. I have chosen here to use `2020, 2021` for the new and
modified files; it is OK that not _all_ files are updated, since the
important bit is the _first_ year, which they already have.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-04 15:19:59 +00:00
Michael Bridgen 8eec8c095c Screen files, and output only those updated
This is intended to address two problems:

 - LocalPackage{Reader,Writer} like to reformat the YAML that passes
   through them; mostly this is harmless, but occasionally it will end
   up fighting format tooling, e.g., prettier.

 - It's possible that things like Helm chart templates are lying
   around in the git repository to which automation is applied. Those
   templates have extensions of ".yaml" but are not usually parseable
   as YAML, so would result in errors from the file reader.

This commit changes how updates are run -- firstly, it screens files
by checking for a token (`"$imagepolicy"`) that will be present in
files that might need updating. This cheaply removes some nodes --
likely including Helm chart templates -- from consideration.

Secondly, it now only writes files that were actually updated by an
imagepolicy setter, rather than writing everything that was an
input. This means it's less likely to reformat something that doesn't
need to be touched at all.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-04 14:44:42 +00:00