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

pantsbuild / pants / 24164262159

08 Apr 2026 11:36PM UTC coverage: 85.889% (-7.0%) from 92.91%
24164262159

Pull #23238

github

web-flow
Merge 88d90acad into 5a129def6
Pull Request #23238: TypeScript: `prettier fmt` crashes with resolve in subdirectory

3 of 3 new or added lines in 1 file covered. (100.0%)

5412 existing lines in 246 files now uncovered.

72530 of 84446 relevant lines covered (85.89%)

3.13 hits per line

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

73.91
/src/python/pants/backend/codegen/thrift/tailor.py
1
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3

4
from __future__ import annotations
1✔
5

6
from dataclasses import dataclass
1✔
7

8
from pants.backend.codegen.thrift.subsystem import ThriftSubsystem
1✔
9
from pants.backend.codegen.thrift.target_types import ThriftSourcesGeneratorTarget
1✔
10
from pants.core.goals.tailor import (
1✔
11
    AllOwnedSources,
12
    PutativeTarget,
13
    PutativeTargets,
14
    PutativeTargetsRequest,
15
)
16
from pants.engine.intrinsics import path_globs_to_paths
1✔
17
from pants.engine.rules import collect_rules, rule
1✔
18
from pants.engine.unions import UnionRule
1✔
19
from pants.util.dirutil import group_by_dir
1✔
20
from pants.util.logging import LogLevel
1✔
21

22

23
@dataclass(frozen=True)
1✔
24
class PutativeThriftTargetsRequest(PutativeTargetsRequest):
1✔
25
    pass
1✔
26

27

28
@rule(level=LogLevel.DEBUG, desc="Determine candidate Thrift targets to create")
1✔
29
async def find_putative_thrift_targets(
1✔
30
    req: PutativeThriftTargetsRequest,
31
    all_owned_sources: AllOwnedSources,
32
    thrift_subsystem: ThriftSubsystem,
33
) -> PutativeTargets:
UNCOV
34
    if not thrift_subsystem.tailor:
×
35
        return PutativeTargets()
×
36

UNCOV
37
    all_thrift_files = await path_globs_to_paths(req.path_globs("*.thrift"))
×
UNCOV
38
    unowned_thrift_files = set(all_thrift_files.files) - set(all_owned_sources)
×
UNCOV
39
    pts = [
×
40
        PutativeTarget.for_target_type(
41
            ThriftSourcesGeneratorTarget,
42
            path=dirname,
43
            name=None,
44
            triggering_sources=sorted(filenames),
45
        )
46
        for dirname, filenames in group_by_dir(unowned_thrift_files).items()
47
    ]
UNCOV
48
    return PutativeTargets(pts)
×
49

50

51
def rules():
1✔
52
    return [
1✔
53
        *collect_rules(),
54
        UnionRule(PutativeTargetsRequest, PutativeThriftTargetsRequest),
55
    ]
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