Skip to content

Commit

Permalink
Auto-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jsh9 committed Nov 8, 2023
1 parent 4b42278 commit 46a8d0c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- Diff
- https://github.com/jsh9/cercis/compare/0.2.4...0.2.5


## [0.2.4] - 2023-10-23

- Changed
Expand Down
2 changes: 1 addition & 1 deletion src/cercis/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def convert_one_fmt_off_pair(node: Node, mode: Mode) -> bool:


def generate_ignored_nodes(
leaf: Leaf, comment: ProtoComment, mode: Mode
leaf: Leaf, comment: ProtoComment, mode: Mode
) -> Iterator[LN]:
"""Starting from the container of `leaf`, generate all leaves until `# fmt: on`.
Expand Down
16 changes: 8 additions & 8 deletions src/cercis/ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def is_valid_line_range(lines: Tuple[int, int]) -> bool:


def adjusted_lines(
lines: Collection[Tuple[int, int]],
original_source: str,
modified_source: str,
lines: Collection[Tuple[int, int]],
original_source: str,
modified_source: str,
) -> List[Tuple[int, int]]:
"""Returns the adjusted line ranges based on edits from the original code.
Expand Down Expand Up @@ -400,8 +400,8 @@ class _LinesMapping:


def _calculate_lines_mappings(
original_source: str,
modified_source: str,
original_source: str,
modified_source: str,
) -> Sequence[_LinesMapping]:
"""Returns a sequence of _LinesMapping by diffing the sources.
Expand Down Expand Up @@ -479,9 +479,9 @@ def _calculate_lines_mappings(


def _find_lines_mapping_index(
original_line: int,
lines_mappings: Sequence[_LinesMapping],
start_index: int,
original_line: int,
lines_mappings: Sequence[_LinesMapping],
start_index: int,
) -> int:
"""Returns the original index of the lines mappings for the original line."""
index = start_index
Expand Down
2 changes: 1 addition & 1 deletion tests/test_black.py
Original file line number Diff line number Diff line change
Expand Up @@ -2669,7 +2669,7 @@ def test_get_sources_with_stdin_filename_and_force_exclude(self) -> None:

@patch("cercis.find_project_root", lambda *args: (THIS_DIR.resolve(), None))
def test_get_sources_with_stdin_filename_and_force_exclude_and_symlink(
self,
self,
) -> None:
# Force exclude should exclude a symlink based on the symlink, not its target
path = THIS_DIR / "data" / "include_exclude_tests"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def func(arg1, arg2, arg3):
],
)
def test_removals(
lines: List[Tuple[int, int]], adjusted: List[Tuple[int, int]]
lines: List[Tuple[int, int]], adjusted: List[Tuple[int, int]]
) -> None:
original_source = """\
1. first line
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_removals(
],
)
def test_additions(
lines: List[Tuple[int, int]], adjusted: List[Tuple[int, int]]
lines: List[Tuple[int, int]], adjusted: List[Tuple[int, int]]
) -> None:
original_source = """\
1. first line
Expand Down

0 comments on commit 46a8d0c

Please sign in to comment.