• 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/shell/lint/shfmt/subsystem.py
1
# Copyright 2021 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
import os.path
×
UNCOV
7
from collections.abc import Iterable
×
8

UNCOV
9
from pants.core.util_rules.config_files import ConfigFilesRequest
×
UNCOV
10
from pants.core.util_rules.external_tool import TemplatedExternalTool
×
UNCOV
11
from pants.option.option_types import ArgsListOption, BoolOption, SkipOption
×
UNCOV
12
from pants.util.strutil import softwrap
×
13

14

UNCOV
15
class Shfmt(TemplatedExternalTool):
×
UNCOV
16
    options_scope = "shfmt"
×
UNCOV
17
    name = "shfmt"
×
UNCOV
18
    help = "An autoformatter for shell scripts (https://github.com/mvdan/sh)."
×
19

UNCOV
20
    default_version = "v3.8.0"
×
UNCOV
21
    default_known_versions = [
×
22
        "v3.2.4|macos_arm64 |e70fc42e69debe3e400347d4f918630cdf4bf2537277d672bbc43490387508ec|2998546",
23
        "v3.2.4|macos_x86_64|43a0461a1b54070ddc04fbbf1b78f7861ee39a65a61f5466d15a39c4aba4f917|2980208",
24
        "v3.2.4|linux_arm64 |6474d9cc08a1c9fe2ef4be7a004951998e3067d46cf55a011ddd5ff7bfab3de6|2752512",
25
        "v3.2.4|linux_x86_64|3f5a47f8fec27fae3e06d611559a2063f5d27e4b9501171dde9959b8c60a3538|2797568",
26
        "v3.6.0|macos_arm64 |633f242246ee0a866c5f5df25cbf61b6af0d5e143555aca32950059cf13d91e0|3065202",
27
        "v3.6.0|macos_x86_64|b8c9c025b498e2816b62f0b717f6032e9ab49e725a45b8205f52f66318f17185|3047552",
28
        "v3.6.0|linux_arm64 |fb1cf0af3dbe9aac7d98e38e3c7426765208ecfe23cb2da51037bb234776fd70|2818048",
29
        "v3.6.0|linux_x86_64|5741a02a641de7e56b8da170e71a97e58050d66a3cf485fb268d6a5a8bb74afb|2850816",
30
        "v3.8.0|macos_arm64 |1481240d2a90d4f0b530688d76d4f9117d17a756b6027cfa42b96f0707317f83|2736466",
31
        "v3.8.0|macos_x86_64|c0218b47a0301bb006f49fad85d2c08de23df303472834faf5639d04121320f8|2747696",
32
        "v3.8.0|linux_arm64 |27e1f69b0d57c584bcbf5c882b4c4f78ffcf945d0efef45c1fbfc6692213c7c3|2687128",
33
        "v3.8.0|linux_x86_64|27b3c6f9d9592fc5b4856c341d1ff2c88856709b9e76469313642a1d7b558fe0|2703512",
34
    ]
35

UNCOV
36
    default_url_template = (
×
37
        "https://github.com/mvdan/sh/releases/download/{version}/shfmt_{version}_{platform}"
38
    )
UNCOV
39
    default_url_platform_mapping = {
×
40
        "macos_arm64": "darwin_arm64",
41
        "macos_x86_64": "darwin_amd64",
42
        "linux_arm64": "linux_arm64",
43
        "linux_x86_64": "linux_amd64",
44
    }
45

UNCOV
46
    skip = SkipOption("fmt", "lint")
×
UNCOV
47
    args = ArgsListOption(example="-i 2")
×
UNCOV
48
    config_discovery = BoolOption(
×
49
        default=True,
50
        advanced=True,
51
        help=softwrap(
52
            """
53
            If true, Pants will include all relevant `.editorconfig` files during runs.
54
            See https://editorconfig.org.
55
            """
56
        ),
57
    )
58

UNCOV
59
    def config_request(self, dirs: Iterable[str]) -> ConfigFilesRequest:
×
60
        # Refer to https://editorconfig.org/#file-location for how config files are discovered.
61
        candidates = (os.path.join(d, ".editorconfig") for d in ("", *dirs))
×
62
        return ConfigFilesRequest(
×
63
            discovery=self.config_discovery,
64
            check_content=dict.fromkeys(candidates, b"[*.sh]"),
65
        )
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