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

pantsbuild / pants / 23173035367

17 Mar 2026 12:47AM UTC coverage: 91.371% (-1.6%) from 92.933%
23173035367

push

github

web-flow
update helm (and friends) to a recent 3.x seies (#23143)

v4 is a major breaking change, so holding off on that. (There was also
just a 3.20, but 3.19 has this reassuring series of bug fixes and was
also quite recent.)

2 of 2 new or added lines in 2 files covered. (100.0%)

1263 existing lines in 73 files now uncovered.

86196 of 94336 relevant lines covered (91.37%)

3.87 hits per line

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

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

UNCOV
4
from __future__ import annotations
×
5

UNCOV
6
import dataclasses
×
UNCOV
7
from collections.abc import Iterable
×
UNCOV
8
from dataclasses import dataclass
×
9

UNCOV
10
from pants.backend.jsx.target_types import (
×
11
    JSX_FILE_EXTENSIONS,
12
    JSXSourcesGeneratorTarget,
13
    JSXTestsGeneratorSourcesField,
14
    JSXTestsGeneratorTarget,
15
)
UNCOV
16
from pants.core.goals.tailor import (
×
17
    AllOwnedSources,
18
    PutativeTarget,
19
    PutativeTargets,
20
    PutativeTargetsRequest,
21
)
UNCOV
22
from pants.core.util_rules.ownership import get_unowned_files_for_globs
×
UNCOV
23
from pants.core.util_rules.source_files import classify_files_for_sources_and_tests
×
UNCOV
24
from pants.engine.rules import Rule, collect_rules, rule
×
UNCOV
25
from pants.engine.unions import UnionRule
×
UNCOV
26
from pants.util.dirutil import group_by_dir
×
UNCOV
27
from pants.util.logging import LogLevel
×
28

29

UNCOV
30
@dataclass(frozen=True)
×
UNCOV
31
class PutativeJSXTargetsRequest(PutativeTargetsRequest):
×
UNCOV
32
    pass
×
33

34

UNCOV
35
@rule(level=LogLevel.DEBUG, desc="Determine candidate JSX targets to create")
×
UNCOV
36
async def find_putative_jsx_targets(
×
37
    req: PutativeJSXTargetsRequest, all_owned_sources: AllOwnedSources
38
) -> PutativeTargets:
UNCOV
39
    unowned_jsx_files = await get_unowned_files_for_globs(
×
40
        req, all_owned_sources, (f"*{ext}" for ext in JSX_FILE_EXTENSIONS)
41
    )
UNCOV
42
    classified_unowned_js_files = classify_files_for_sources_and_tests(
×
43
        paths=unowned_jsx_files,
44
        test_file_glob=JSXTestsGeneratorSourcesField.default,
45
        sources_generator=JSXSourcesGeneratorTarget,
46
        tests_generator=JSXTestsGeneratorTarget,
47
    )
48

UNCOV
49
    return PutativeTargets(
×
50
        PutativeTarget.for_target_type(
51
            tgt_type, path=dirname, name=name, triggering_sources=sorted(filenames)
52
        )
53
        for tgt_type, paths, name in (dataclasses.astuple(f) for f in classified_unowned_js_files)
54
        for dirname, filenames in group_by_dir(paths).items()
55
    )
56

57

UNCOV
58
def rules() -> Iterable[Rule | UnionRule]:
×
UNCOV
59
    return (
×
60
        *collect_rules(),
61
        UnionRule(PutativeTargetsRequest, PutativeJSXTargetsRequest),
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