Skip to content

Commit 72ae8c1

Browse files
committed
context: add changelog_entry_by_index() helper
1 parent e4575ea commit 72ae8c1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ubuntu_lint/context.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,16 @@ def changes(self) -> deb822.Changes:
8484

8585
return self._changes
8686

87-
@property
88-
def changelog_entry(self) -> changelog.ChangeBlock:
87+
def changelog_entry_by_index(self, index: int) -> changelog.ChangeBlock:
8988
if not self._changelog:
9089
raise MissingContextException("missing context for changelog entry")
9190
assert self._changelog is not None
9291

93-
return self._changelog[0]
92+
return self._changelog[index]
93+
94+
@property
95+
def changelog_entry(self) -> changelog.ChangeBlock:
96+
return self.changelog_entry_by_index(0)
9497

9598
@property
9699
def lp(self) -> Launchpad:

0 commit comments

Comments
 (0)