• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 21552830208

31 Jan 2026 11:40PM UTC coverage: 80.277% (-0.05%) from 80.324%
21552830208

Pull #23062

github

web-flow
Merge 808a9786c into 2c4dcf9cf
Pull Request #23062: Remove support for Get

18 of 25 new or added lines in 4 files covered. (72.0%)

17119 existing lines in 541 files now uncovered.

78278 of 97510 relevant lines covered (80.28%)

3.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.45
/src/python/pants/vcs/hunk.py
1
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
from dataclasses import dataclass
12✔
4

5
from pants.engine.collection import Collection
12✔
6

7

8
@dataclass(frozen=True)
12✔
9
class TextBlock:
12✔
10
    """Block of lines in a file.
11

12
    Lines are 1 indexed, `start` is inclusive.
13

14
    TextBlock is used as a part of unified diff hunk, thus it can be empty,
15
    i.e. count can be equal to 0. In the special case when the file is empty
16
    start = 0 and count = 0.
17
    """
18

19
    start: int
12✔
20
    count: int
12✔
21

22
    def __init__(self, start: int, count: int):
12✔
UNCOV
23
        object.__setattr__(self, "start", start)
2✔
UNCOV
24
        object.__setattr__(self, "count", count)
2✔
25

UNCOV
26
        self.__post_init__()
2✔
27

28
    def __post_init__(self):
12✔
UNCOV
29
        if self.count < 0:
2✔
30
            raise ValueError(f"{self.count=} can't be negative")
×
31

32
    @property
12✔
33
    def end(self) -> int:
12✔
UNCOV
34
        return self.start + self.count
1✔
35

36

37
class TextBlocks(Collection[TextBlock]):
12✔
38
    pass
12✔
39

40

41
@dataclass(frozen=True)
12✔
42
class Hunk:
12✔
43
    """Hunk of difference in unified format.
44

45
    https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
46

47
    In the special case when file is created left = None.
48
    In the special case when file is deleted right = None.
49
    """
50

51
    left: TextBlock | None
12✔
52
    right: TextBlock | None
12✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc