Skip to content

Commit

Permalink
Adhere to column limit
Browse files Browse the repository at this point in the history
  • Loading branch information
boehmseb committed Mar 18, 2024
1 parent 2958347 commit 48a0418
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions varats/varats/tools/driver_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,22 @@ def parse_string(
def to_xml(self) -> str:
"""Convert the location to SPLConqueror feature model format."""
xml = f"<path>{self.file}</path>\n"
xml += f"<start><line>{self.start_line}</line><column>{self.start_col}</column></start>\n"
xml += f"<end><line>{self.end_line}</line><column>{self.end_col}</column></end>\n"
xml += (
f"<start><line>{self.start_line}</line>"
f"<column>{self.start_col}</column></start>\n"
)
xml += (
f"<end><line>{self.end_line}</line>"
f"<column>{self.end_col}</column></end>\n"
)
return xml

def __str__(self) -> str:
return f"{self.file} {self.start_line}:{self.start_col} {self.end_line}:{self.end_col}"
return (
f"{self.file} "
f"{self.start_line}:{self.start_col} "
f"{self.end_line}:{self.end_col}"
)


class FeatureAnnotation:
Expand Down Expand Up @@ -119,7 +129,8 @@ def __prompt_location(
return tp.cast(
Location,
click.prompt(
f"Enter location for feature {feature_name} @ {commit_hash.short_hash}",
f"Enter location for feature "
f"{feature_name} @ {commit_hash.short_hash}",
value_proc=parse_location
)
)
Expand Down Expand Up @@ -196,7 +207,8 @@ def __annotate(
last_annotation_targets[feature_name] = target
tracked_features[feature_name] = []
LOG.debug(
f"Tracking {feature_name} @ {location}: {last_annotation_targets[feature_name]}"
f"Tracking {feature_name} @ {location}: "
f"{last_annotation_targets[feature_name]}"
)

for commit in walker:
Expand All @@ -207,7 +219,8 @@ def __annotate(
current_target = __get_location_content(commit, annotation.location)
if current_target != last_annotation_targets[feature]:
LOG.debug(
f"{feature}: {current_target} != {last_annotation_targets[feature]}"
f"{feature}: "
f"{current_target} != {last_annotation_targets[feature]}"
)
# set removed field for annotation and store it
tracked_features[feature].append(
Expand All @@ -229,7 +242,8 @@ def __annotate(
assert new_target is not None, "Target must not be None"
last_annotation_targets[feature] = new_target
LOG.debug(
f"Tracking {feature} @ {new_location}: {last_annotation_targets[feature]}"
f"Tracking {feature} @ {new_location}: "
f"{last_annotation_targets[feature]}"
)

# store remaining annotations
Expand Down

0 comments on commit 48a0418

Please sign in to comment.