diff --git a/src/check_oldies/annotations.py b/src/check_oldies/annotations.py index 8f96b24..fbf5f91 100644 --- a/src/check_oldies/annotations.py +++ b/src/check_oldies/annotations.py @@ -74,7 +74,7 @@ def py_assignee_regex(self): @dataclasses.dataclass class Annotation: - filename: str + path: str line_no: int line_content: str age: int = None @@ -88,12 +88,12 @@ def must_warn(self): def to_text(self): return ( f"{self.assignee: <15} - {self.age: >4} days - " - f"{self.filename}:{self.line_no}: {self.line_content.strip()}" + f"{self.path}:{self.line_no}: {self.line_content.strip()}" ) def to_dict(self): return { - "filename": self.filename, + "path": self.path, "line_no": self.line_no, "assignee": self.assignee, "line_content": self.line_content, @@ -196,7 +196,7 @@ def get_annotations(config: Config): for annotation in annotations: last_committer, last_modification = get_line_blame( - annotation.filename, annotation.line_no, cwd=config.path + annotation.path, annotation.line_no, cwd=config.path ) last_committer = get_login_from_committer_email(last_committer) match = config.py_assignee_regex.search(annotation.line_content) diff --git a/src/check_oldies/check_fixmes.py b/src/check_oldies/check_fixmes.py index 247d8c0..900e98a 100755 --- a/src/check_oldies/check_fixmes.py +++ b/src/check_oldies/check_fixmes.py @@ -70,7 +70,7 @@ def main(): annotations = check_oldies.annotations.get_annotations(config) if config.only_old: annotations = [a for a in annotations if a.is_old] - annotations.sort(key=lambda f: (f.assignee, -f.age, f.filename, f.line_no)) + annotations.sort(key=lambda f: (f.assignee, -f.age, f.path, f.line_no)) has_old_annotations = any(ann for ann in annotations if ann.is_old) ok_msg = err_msg = "" diff --git a/src/check_oldies/forget_me_not.py b/src/check_oldies/forget_me_not.py index 82baae6..6331e8c 100644 --- a/src/check_oldies/forget_me_not.py +++ b/src/check_oldies/forget_me_not.py @@ -194,7 +194,7 @@ def generate_emails(reports_by_email, config): config.email_body_annotation_line_template.format( age=annotation.age, repo=annotation.repository, - path=annotation.filename, + path=annotation.path, line_no=annotation.line_no, line_content=annotation.line_content.strip(), )