• 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

65.52
/src/python/pants/backend/cc/goals/tailor.py
1
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

UNCOV
4
from __future__ import annotations
1✔
5

UNCOV
6
from collections.abc import Iterable
1✔
UNCOV
7
from dataclasses import dataclass
1✔
8

UNCOV
9
from pants.backend.cc.target_types import CC_FILE_EXTENSIONS, CCSourcesGeneratorTarget
1✔
UNCOV
10
from pants.core.goals.tailor import (
1✔
11
    AllOwnedSources,
12
    PutativeTarget,
13
    PutativeTargets,
14
    PutativeTargetsRequest,
15
)
UNCOV
16
from pants.engine.intrinsics import path_globs_to_paths
1✔
UNCOV
17
from pants.engine.rules import collect_rules, rule
1✔
UNCOV
18
from pants.engine.target import Target
1✔
UNCOV
19
from pants.engine.unions import UnionRule
1✔
UNCOV
20
from pants.util.dirutil import group_by_dir
1✔
UNCOV
21
from pants.util.logging import LogLevel
1✔
22

23

UNCOV
24
@dataclass(frozen=True)
1✔
UNCOV
25
class PutativeCCTargetsRequest(PutativeTargetsRequest):
1✔
UNCOV
26
    pass
1✔
27

28

UNCOV
29
def classify_source_files(paths: Iterable[str]) -> dict[type[Target], set[str]]:
1✔
30
    """Returns a dict of target type -> files that belong to targets of that type."""
31
    sources_files = set(paths)
×
32
    return {CCSourcesGeneratorTarget: sources_files}
×
33

34

UNCOV
35
@rule(level=LogLevel.DEBUG, desc="Determine candidate CC targets to create")
1✔
UNCOV
36
async def find_putative_targets(
1✔
37
    req: PutativeCCTargetsRequest,
38
    all_owned_sources: AllOwnedSources,
39
) -> PutativeTargets:
40
    all_cc_files = await path_globs_to_paths(
×
41
        req.path_globs(*(f"*{ext}" for ext in CC_FILE_EXTENSIONS))
42
    )
43
    unowned_cc_files = set(all_cc_files.files) - set(all_owned_sources)
×
44
    classified_unowned_kotlin_files = classify_source_files(unowned_cc_files)
×
45

46
    putative_targets: list[PutativeTarget] = []
×
47
    for tgt_type, paths in classified_unowned_kotlin_files.items():
×
48
        for dirname, filenames in group_by_dir(paths).items():
×
49
            putative_targets.append(
×
50
                PutativeTarget.for_target_type(
51
                    tgt_type, path=dirname, name=None, triggering_sources=sorted(filenames)
52
                )
53
            )
54

55
    return PutativeTargets(putative_targets)
×
56

57

UNCOV
58
def rules():
1✔
UNCOV
59
    return [
1✔
60
        *collect_rules(),
61
        UnionRule(PutativeTargetsRequest, PutativeCCTargetsRequest),
62
    ]
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