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

pantsbuild / pants / 19383812239

15 Nov 2025 03:34AM UTC coverage: 43.269% (-37.0%) from 80.284%
19383812239

Pull #22888

github

web-flow
Merge 2ffdbbb61 into cb4d9339a
Pull Request #22888: Bump the gha-deps group across 1 directory with 3 updates

25959 of 59995 relevant lines covered (43.27%)

0.87 hits per line

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

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

4
from __future__ import annotations
×
5

6
import logging
×
7

8
from pants.backend.kotlin.target_types import KotlinFieldSet
×
9
from pants.core.goals.check import CheckRequest, CheckResult, CheckResults
×
10
from pants.engine.addresses import Addresses
×
11
from pants.engine.internals.graph import resolve_coarsened_targets as coarsened_targets_get
×
12
from pants.engine.rules import collect_rules, concurrently, implicitly, rule
×
13
from pants.engine.target import CoarsenedTargets
×
14
from pants.engine.unions import UnionRule
×
15
from pants.jvm.compile import (
×
16
    ClasspathEntryRequest,
17
    ClasspathEntryRequestFactory,
18
    get_fallible_classpath_entry,
19
)
20
from pants.jvm.resolve.coursier_fetch import select_coursier_resolve_for_targets
×
21
from pants.util.logging import LogLevel
×
22

23
logger = logging.getLogger(__name__)
×
24

25

26
class KotlincCheckRequest(CheckRequest):
×
27
    field_set_type = KotlinFieldSet
×
28
    tool_name = "kotlinc"
×
29

30

31
@rule(desc="Check compilation for Kotlin", level=LogLevel.DEBUG)
×
32
async def kotlinc_check(
×
33
    request: KotlincCheckRequest,
34
    classpath_entry_request: ClasspathEntryRequestFactory,
35
) -> CheckResults:
36
    coarsened_targets = await coarsened_targets_get(
×
37
        **implicitly(Addresses(field_set.address for field_set in request.field_sets))
38
    )
39

40
    # NB: Each root can have an independent resolve, because there is no inherent relation
41
    # between them other than that they were on the commandline together.
42
    resolves = await concurrently(
×
43
        select_coursier_resolve_for_targets(CoarsenedTargets([t]), **implicitly())
44
        for t in coarsened_targets
45
    )
46

47
    results = await concurrently(
×
48
        get_fallible_classpath_entry(
49
            **implicitly(
50
                {
51
                    classpath_entry_request.for_targets(
52
                        component=target, resolve=resolve
53
                    ): ClasspathEntryRequest
54
                }
55
            )
56
        )
57
        for target, resolve in zip(coarsened_targets, resolves)
58
    )
59

60
    # NB: We don't pass stdout/stderr as it will have already been rendered as streaming.
61
    exit_code = next((result.exit_code for result in results if result.exit_code != 0), 0)
×
62
    return CheckResults([CheckResult(exit_code, "", "")], checker_name=request.tool_name)
×
63

64

65
def rules():
×
66
    return (*collect_rules(), UnionRule(CheckRequest, KotlincCheckRequest))
×
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