Skip to content

Commit

Permalink
Change series lint from warn to info message (#618)
Browse files Browse the repository at this point in the history
As a 'warn' the message causes the charm proof to fail which will fail
most builds.  This patch changes it to 'info'.
  • Loading branch information
ajkavanagh authored Aug 2, 2022
1 parent c70f886 commit fe92638
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions charmtools/charms.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,15 +811,17 @@ def validate_series(charm, linter):
The `series` parameter is deprecated because charmcraft ignores it and
uses `bases` from `charmcraft.yaml`. This function checks if the series
is in metadata.yaml and displays a warning message if so.
is in metadata.yaml and displays an info message if so. Note that it is not
a warning as that causes an error in the charm proof which isn't what is
wanted.
:param charm: dict of charm metadata parsed from metadata.yaml
:param linter: :class:`CharmLinter` object to which info/warning/error
messages will be written
"""
if 'series' in charm:
linter.warn('DEPRECATED: series parameter is ignored by charmcraft,'
linter.info('DEPRECATED: series parameter is ignored by charmcraft,'
'use bases in charmcraft.yaml')


Expand Down
2 changes: 1 addition & 1 deletion tests/test_charm_proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ def test_series(self):
linter = Mock()
charm = {"series": []}
validate_series(charm, linter)
self.assertTrue(linter.warn.called)
self.assertTrue(linter.info.called)


class TermsValidationTest(TestCase):
Expand Down

0 comments on commit fe92638

Please sign in to comment.