Skip to content

Line filter can be extended 3 lines above changes and 3 lines below #147

@bwrsandman

Description

@bwrsandman

Take this change as an example

 MyClass::~MyClass()   # L1 -> L1
 {                     # L2 -> L2
-    delete m_Member1; # L3 -> x
-    delete m_Member2; # L4 -> x
-    delete m_Member3; # L5 -> x
 }                     # L6 -> L3

If I run clang tidy on it it will tell me that modernize-use-equals-default requires it be written as

MyClass::~MyClass() = default;

However, clang-tidy review's line filter will only include added lines when the change is required to be on L1. This means clang-tidy review will miss this fix.

In a github review, you are able to make a comment on 3 lines above and below a changed line before the option is no longer available.

My proposal is to modify get_line_ranges so that:

Added lines:

  • each group range has its start decremented by 3 (min of 1)
  • the size extended by 6 (max of line number in file - start - 1)
    Removed lines:
  • Make a group that extends from the preceeding line (after change) to 2 above and 3 below

Care must be made to be sure to combine overlapping groups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions