• 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/taplo/subsystem.py
1
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
2
# Licensed under the Apache License, Version 2.0 (see LICENSE).
3
from __future__ import annotations
×
4

5
from pathlib import PurePosixPath
×
6

7
from pants.core.util_rules.config_files import ConfigFilesRequest
×
8
from pants.core.util_rules.external_tool import TemplatedExternalTool
×
9
from pants.engine.platform import Platform
×
10
from pants.option.option_types import ArgsListOption, BoolOption, SkipOption, StrListOption
×
11
from pants.util.strutil import softwrap
×
12

13

14
class Taplo(TemplatedExternalTool):
×
15
    help = "An autoformatter for TOML files (https://taplo.tamasfe.dev/)"
×
16

17
    options_scope = "taplo"
×
18
    name = "Taplo"
×
19
    default_version = "0.9.3"
×
20
    default_known_versions = [
×
21
        "0.9.3|macos_x86_64|6b4180fe0518e3e68b9a421dbe50f62ede308767972c4c70c6bbe6651ea98641|4243525",
22
        "0.9.3|macos_arm64|39b84d62d6a47855b2c64148cde9c9ca5721bf422b8c9fe9c92776860badde5f|4039644",
23
        "0.9.3|linux_x86_64|889efcfa067b179fda488427d3b13ce2d679537da8b9ed8138ba415db7da2a5e|4477376",
24
        "0.9.3|linux_arm64|7c07379d3288fb5c26b1c29bbedec4f8d8f602d776bcc3a1578176733b6a857c|4393144",
25
        "0.8.0|macos_x86_64|a1917f1b9168cb4f7d579422dcdf9c733028d873963d8fa3a6f499e41719c502|3926263",
26
        "0.8.0|macos_arm64|79c1691c3c46be981fa0cec930ec9a6d6c4ffd27272d37d1885514ce59bd8ccf|3661689",
27
        "0.8.0|linux_x86_64|3703294fac37ca9a9f76308f9f98c3939ccb7588f8972acec68a48d7a10d8ee5|4123593",
28
        "0.8.0|linux_arm64|a6a94482f125c21090593f94cad23df099c4924f5b9620cda4a8653527c097a1|3995383",
29
    ]
30
    default_url_template = (
×
31
        "https://github.com/tamasfe/taplo/releases/download/{version}/taplo-{platform}.gz"
32
    )
33
    default_url_platform_mapping = {
×
34
        "macos_arm64": "darwin-aarch64",
35
        "macos_x86_64": "darwin-x86_64",
36
        "linux_arm64": "linux-aarch64",
37
        "linux_x86_64": "linux-x86_64",
38
    }
39

40
    skip = SkipOption("fmt", "lint")
×
41
    args = ArgsListOption(example="--option=align_entries=false")
×
42
    config_discovery = BoolOption(
×
43
        default=True,
44
        advanced=True,
45
        help=softwrap(
46
            """
47
            If true, Pants will include a `taplo.toml` or `.taplo.toml` file found in
48
            the build root during a run.
49
            """
50
        ),
51
    )
52

53
    glob_pattern = StrListOption(
×
54
        help=softwrap(
55
            """
56
            A list of glob patterns of files to include/exclude in formatting relative
57
            to the build root. Leading exclamation points exclude an item from
58
            formatting.
59

60
            Example:
61

62
                ["**/*.toml", "**/pyproject.toml", "!pyproject.toml"]
63

64
            The default includes all files with a `.toml` extension recursively and excludes
65
            `.taplo.toml` or `taplo.toml` files in the build root.
66
            """
67
        ),
68
        advanced=True,
69
        default=["**/*.toml", "!.taplo.toml", "!taplo.toml"],
70
    )
71

72
    def generate_exe(self, plat: Platform) -> str:
×
73
        exe = super().generate_exe(plat)
×
74
        return PurePosixPath(exe).stem
×
75

76
    def config_request(self) -> ConfigFilesRequest:
×
77
        return ConfigFilesRequest(
×
78
            discovery=self.config_discovery,
79
            check_existence=[".taplo.toml", "taplo.toml"],
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