Skip to content

Commit

Permalink
refactor: Set lineno to 0 for removed objects when checking API
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 16, 2024
1 parent f2ece1e commit b660c34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/griffe/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ def _relative_path(self) -> str:

@property
def _lineno(self) -> int:
if self.kind is BreakageKind.OBJECT_REMOVED:
return 0
if self.obj.is_alias:
return self.obj.alias_lineno or 0 # type: ignore[attr-defined]
return self.obj.lineno or 0
Expand Down

0 comments on commit b660c34

Please sign in to comment.