• 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/tools/yamllint/subsystem.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
from collections.abc import Iterable
×
7

UNCOV
8
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
×
UNCOV
9
from pants.backend.python.target_types import ConsoleScript
×
UNCOV
10
from pants.core.goals.resolves import ExportableTool
×
UNCOV
11
from pants.core.util_rules.config_files import OrphanFilepathConfigBehavior
×
UNCOV
12
from pants.engine.rules import Rule, collect_rules
×
UNCOV
13
from pants.engine.unions import UnionRule
×
UNCOV
14
from pants.option.option_types import (
×
15
    ArgsListOption,
16
    EnumOption,
17
    SkipOption,
18
    StrListOption,
19
    StrOption,
20
)
UNCOV
21
from pants.util.strutil import softwrap
×
22

23

UNCOV
24
class Yamllint(PythonToolBase):
×
UNCOV
25
    name = "Yamllint"
×
UNCOV
26
    options_scope = "yamllint"
×
UNCOV
27
    help_short = "A linter for YAML files (https://yamllint.readthedocs.io)"
×
28

UNCOV
29
    default_main = ConsoleScript("yamllint")
×
UNCOV
30
    default_requirements = ["yamllint>=1.28.0,<2"]
×
31

UNCOV
32
    register_interpreter_constraints = True
×
33

UNCOV
34
    default_lockfile_resource = ("pants.backend.tools.yamllint", "yamllint.lock")
×
35

UNCOV
36
    config_file_name = StrOption(
×
37
        "--config-file-name",
38
        default=".yamllint",
39
        advanced=True,
40
        help=softwrap(
41
            """
42
            Name of a config file understood by yamllint (https://yamllint.readthedocs.io/en/stable/configuration.html).
43
            The plugin will search the ancestors of each directory in which YAML files are found for a config file of this name.
44
            """
45
        ),
46
    )
47

UNCOV
48
    orphan_files_behavior = EnumOption(
×
49
        default=OrphanFilepathConfigBehavior.IGNORE,
50
        advanced=True,
51
        help=softwrap(
52
            f"""
53
            Whether to ignore, error or show a warning when files are found that are not
54
            covered by the config file provided in `[{options_scope}].config_file_name` setting.
55
            """
56
        ),
57
    )
58

UNCOV
59
    file_glob_include = StrListOption(
×
60
        "--include",
61
        default=["**/*.yml", "**/*.yaml"],
62
        help="Glob for which YAML files to lint.",
63
    )
64

UNCOV
65
    file_glob_exclude = StrListOption(
×
66
        "--exclude",
67
        default=[],
68
        help="Glob for which YAML files to exclude from linting.",
69
    )
70

UNCOV
71
    args = ArgsListOption(example="-d relaxed")
×
72

UNCOV
73
    skip = SkipOption("lint")
×
74

75

UNCOV
76
def rules() -> Iterable[Rule | UnionRule]:
×
77
    return [
×
78
        *collect_rules(),
79
        UnionRule(ExportableTool, Yamllint),
80
    ]
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