• 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/python/lint/pydocstyle/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 dataclasses import dataclass
×
7

UNCOV
8
from pants.backend.python.goals import lockfile
×
UNCOV
9
from pants.backend.python.lint.pydocstyle.skip_field import SkipPydocstyleField
×
UNCOV
10
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
×
UNCOV
11
from pants.backend.python.target_types import ConsoleScript, PythonSourceField
×
UNCOV
12
from pants.core.goals.resolves import ExportableTool
×
UNCOV
13
from pants.core.util_rules.config_files import ConfigFilesRequest
×
UNCOV
14
from pants.engine.rules import collect_rules
×
UNCOV
15
from pants.engine.target import FieldSet, Target
×
UNCOV
16
from pants.engine.unions import UnionRule
×
UNCOV
17
from pants.option.option_types import ArgsListOption, BoolOption, FileOption, SkipOption
×
UNCOV
18
from pants.util.docutil import bin_name
×
UNCOV
19
from pants.util.strutil import softwrap
×
20

21

UNCOV
22
@dataclass(frozen=True)
×
UNCOV
23
class PydocstyleFieldSet(FieldSet):
×
UNCOV
24
    required_fields = (PythonSourceField,)
×
25

UNCOV
26
    source: PythonSourceField
×
27

UNCOV
28
    @classmethod
×
UNCOV
29
    def opt_out(cls, tgt: Target) -> bool:
×
30
        return tgt.get(SkipPydocstyleField).value
×
31

32

UNCOV
33
class Pydocstyle(PythonToolBase):
×
UNCOV
34
    options_scope = "pydocstyle"
×
UNCOV
35
    name = "Pydocstyle"
×
UNCOV
36
    help_short = "A tool for checking compliance with Python docstring conventions (http://www.pydocstyle.org/en/stable/)."
×
37

UNCOV
38
    default_main = ConsoleScript("pydocstyle")
×
UNCOV
39
    default_requirements = ["pydocstyle[toml]>=6.1.1,<7.0"]
×
40

UNCOV
41
    register_interpreter_constraints = True
×
42

UNCOV
43
    default_lockfile_resource = ("pants.backend.python.lint.pydocstyle", "pydocstyle.lock")
×
44

UNCOV
45
    skip = SkipOption("lint")
×
UNCOV
46
    args = ArgsListOption(example="--select=D101,D102")
×
UNCOV
47
    config = FileOption(
×
48
        default=None,
49
        advanced=True,
50
        help="Path to a Pydocstyle config file (http://www.pydocstyle.org/en/stable/usage.html#configuration-files).",
51
    )
UNCOV
52
    config_discovery = BoolOption(
×
53
        default=True,
54
        advanced=True,
55
        help=lambda cls: softwrap(
56
            f"""
57
            If true, Pants will include any relevant config files during runs
58
            (`setup.cfg`, `tox.ini`, `.pydocstyle`, `.pydocstyle.ini`, `.pydocstylerc`, `.pydocstylerc.ini`,
59
            and `pyproject.toml`) searching for the configuration file in this particular order.
60

61
            Please note that even though `pydocstyle` keeps looking for a configuration file up the
62
            directory tree until one is found, Pants will only search for the config files in the
63
            repository root (from where you would normally run the `{bin_name()}` command).
64

65
            Use `[{cls.options_scope}].config` instead if your config is in a non-standard location.
66
            """
67
        ),
68
    )
69

UNCOV
70
    @property
×
UNCOV
71
    def config_request(self) -> ConfigFilesRequest:
×
72
        # Refer to http://www.pydocstyle.org/en/stable/usage.html#configuration-files. Pydocstyle will search
73
        # configuration files in a particular order.
74
        return ConfigFilesRequest(
×
75
            specified=self.config,
76
            specified_option_name=f"{self.options_scope}.config",
77
            discovery=self.config_discovery,
78
            check_existence=[
79
                ".pydocstyle",
80
                ".pydocstyle.ini",
81
                ".pydocstylerc",
82
                ".pydocstylerc.ini",
83
            ],
84
            check_content={
85
                "setup.cfg": b"[pydocstyle]",
86
                "tox.ini": b"[pydocstyle]",
87
                "pyproject.toml": b"[tool.pydocstyle]",
88
            },
89
        )
90

91

UNCOV
92
def rules():
×
UNCOV
93
    return (
×
94
        *collect_rules(),
95
        *lockfile.rules(),
96
        UnionRule(ExportableTool, Pydocstyle),
97
    )
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

© 2025 Coveralls, Inc