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

pantsbuild / pants / 20328535594

18 Dec 2025 06:46AM UTC coverage: 57.969% (-22.3%) from 80.295%
20328535594

Pull #22954

github

web-flow
Merge ccc9c5409 into 407284c67
Pull Request #22954: free up disk space in runner image

39083 of 67421 relevant lines covered (57.97%)

0.91 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

4
from __future__ import annotations
×
5

6
from collections.abc import Iterable
×
7

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

23

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

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

32
    register_interpreter_constraints = True
×
33

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

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

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

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

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

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

73
    skip = SkipOption("lint")
×
74

75

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