Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change series lint from warn to info message #618

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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