• 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/codegen/protobuf/lint/buf/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 pants.core.util_rules.config_files import ConfigFilesRequest
×
UNCOV
7
from pants.core.util_rules.external_tool import TemplatedExternalTool
×
UNCOV
8
from pants.engine.platform import Platform
×
UNCOV
9
from pants.option.option_types import ArgsListOption, BoolOption, FileOption, SkipOption
×
UNCOV
10
from pants.util.strutil import softwrap
×
11

12

UNCOV
13
class BufSubsystem(TemplatedExternalTool):
×
UNCOV
14
    options_scope = "buf"
×
UNCOV
15
    name = "Buf"
×
UNCOV
16
    help = "A linter and formatter for Protocol Buffers (https://github.com/bufbuild/buf)."
×
17

UNCOV
18
    default_version = "v1.3.0"
×
UNCOV
19
    default_known_versions = [
×
20
        "v1.3.0|linux_arm64 |fbfd53c501451b36900247734bfa4cbe86ae05d0f51bc298de8711d5ee374ee5|13940828",
21
        "v1.3.0|linux_x86_64|e29c4283b1cd68ada41fa493171c41d7605750d258fcd6ecdf692a63fae95213|15267162",
22
        "v1.3.0|macos_arm64 |147985d7f2816a545792e38b26178ff4027bf16cd3712f6e387a4e3692a16deb|15391890",
23
        "v1.3.0|macos_x86_64|3b6bd2e5a5dd758178aee01fb067261baf5d31bfebe93336915bfdf7b21928c4|15955291",
24
    ]
UNCOV
25
    default_url_template = (
×
26
        "https://github.com/bufbuild/buf/releases/download/{version}/buf-{platform}.tar.gz"
27
    )
UNCOV
28
    default_url_platform_mapping = {
×
29
        "macos_arm64": "Darwin-arm64",
30
        "macos_x86_64": "Darwin-x86_64",
31
        "linux_arm64": "Linux-aarch64",
32
        "linux_x86_64": "Linux-x86_64",
33
    }
34

UNCOV
35
    format_skip = SkipOption("fmt", "lint")
×
UNCOV
36
    lint_skip = SkipOption("lint")
×
UNCOV
37
    format_args = ArgsListOption(example="--error-format json")
×
UNCOV
38
    lint_args = ArgsListOption(example="--error-format json")
×
39

UNCOV
40
    config = FileOption(
×
41
        default=None,
42
        advanced=True,
43
        help=lambda cls: softwrap(
44
            f"""
45
            Path to a config file understood by Buf
46
            (https://docs.buf.build/configuration/overview).
47

48
            Setting this option will disable `[{cls.options_scope}].config_discovery`. Use
49
            this option if the config is located in a non-standard location.
50
            """
51
        ),
52
    )
UNCOV
53
    config_discovery = BoolOption(
×
54
        default=True,
55
        advanced=True,
56
        help=lambda cls: softwrap(
57
            f"""
58
            If true, Pants will include any relevant root config files during runs
59
            (`buf.yaml`). If the json format is preferred, the path to the `buf.json`
60
            file should be provided in the config option.
61

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

UNCOV
67
    @property
×
UNCOV
68
    def config_request(self) -> ConfigFilesRequest:
×
69
        # Refer to https://docs.buf.build/configuration/overview.
70
        return ConfigFilesRequest(
×
71
            specified=self.config,
72
            specified_option_name=f"{self.options_scope}.config",
73
            discovery=self.config_discovery,
74
            check_existence=("buf.yaml",),
75
            check_content={},
76
        )
77

UNCOV
78
    def generate_exe(self, plat: Platform) -> str:
×
79
        return "./buf/bin/buf"
×
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