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

pantsbuild / pants / 19015773527

02 Nov 2025 05:33PM UTC coverage: 17.872% (-62.4%) from 80.3%
19015773527

Pull #22816

github

web-flow
Merge a12d75757 into 6c024e162
Pull Request #22816: Update Pants internal Python to 3.14

4 of 5 new or added lines in 3 files covered. (80.0%)

28452 existing lines in 683 files now uncovered.

9831 of 55007 relevant lines covered (17.87%)

0.18 hits per line

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

0.0
/src/python/pants/backend/helm/goals/lint.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
×
5

UNCOV
6
import logging
×
UNCOV
7
from dataclasses import dataclass
×
8

UNCOV
9
from pants.backend.helm.subsystems.helm import HelmSubsystem
×
UNCOV
10
from pants.backend.helm.target_types import (
×
11
    HelmChartFieldSet,
12
    HelmChartLintQuietField,
13
    HelmChartLintStrictField,
14
    HelmSkipLintField,
15
)
UNCOV
16
from pants.backend.helm.util_rules import tool
×
UNCOV
17
from pants.backend.helm.util_rules.chart import HelmChart, HelmChartRequest, get_helm_chart
×
UNCOV
18
from pants.backend.helm.util_rules.tool import HelmProcess
×
UNCOV
19
from pants.core.goals.lint import LintResult, LintTargetsRequest, Partitions
×
UNCOV
20
from pants.core.util_rules.partitions import Partition
×
UNCOV
21
from pants.engine.intrinsics import execute_process
×
UNCOV
22
from pants.engine.rules import collect_rules, concurrently, implicitly, rule
×
UNCOV
23
from pants.util.logging import LogLevel
×
24

UNCOV
25
logger = logging.getLogger(__name__)
×
26

27

UNCOV
28
@dataclass(frozen=True)
×
UNCOV
29
class HelmLintFieldSet(HelmChartFieldSet):
×
UNCOV
30
    lint_strict: HelmChartLintStrictField
×
UNCOV
31
    lint_quiet: HelmChartLintQuietField
×
UNCOV
32
    skip_lint: HelmSkipLintField
×
33

34

UNCOV
35
class HelmLintRequest(LintTargetsRequest):
×
UNCOV
36
    field_set_type = HelmLintFieldSet
×
UNCOV
37
    tool_subsystem = HelmSubsystem  # type: ignore[assignment]
×
38

39

UNCOV
40
@rule
×
UNCOV
41
async def partition_helm_lint(
×
42
    request: HelmLintRequest.PartitionRequest[HelmLintFieldSet],
43
) -> Partitions[HelmLintFieldSet, HelmChart]:
44
    field_sets = tuple(
×
45
        field_set for field_set in request.field_sets if not field_set.skip_lint.value
46
    )
47
    charts = await concurrently(
×
48
        get_helm_chart(HelmChartRequest(field_set), **implicitly()) for field_set in field_sets
49
    )
50
    return Partitions(
×
51
        Partition((field_set,), chart) for chart, field_set in zip(charts, field_sets)
52
    )
53

54

UNCOV
55
@rule(desc="Lint Helm charts", level=LogLevel.DEBUG)
×
UNCOV
56
async def run_helm_lint(
×
57
    request: HelmLintRequest.Batch[HelmLintFieldSet, HelmChart],
58
    helm_subsystem: HelmSubsystem,
59
) -> LintResult:
60
    assert len(request.elements) == 1
×
61
    assert request.partition_metadata is not None
×
62

63
    field_set = request.elements[0]
×
64
    chart = request.partition_metadata
×
65

66
    argv = ["lint", chart.name]
×
67

68
    strict = field_set.lint_strict.value or helm_subsystem.lint_strict
×
69
    if strict:
×
70
        argv.append("--strict")
×
71
    quiet = field_set.lint_quiet.value or helm_subsystem.lint_quiet
×
72
    if quiet:
×
73
        argv.append("--quiet")
×
74

75
    process_result = await execute_process(
×
76
        **implicitly(
77
            HelmProcess(
78
                argv,
79
                extra_immutable_input_digests=chart.immutable_input_digests,
80
                description=f"Linting chart: {chart.info.name}",
81
            )
82
        )
83
    )
84
    return LintResult.create(request, process_result)
×
85

86

UNCOV
87
def rules():
×
UNCOV
88
    return [*collect_rules(), *tool.rules(), *HelmLintRequest.rules()]
×
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