Skip to content

Commit e26a818

Browse files
authored
Merge pull request #66 from scop/renovate/mvdan-sh-3.x
chore(deps): update mvdan/sh to v3.13.0
2 parents 88c0fc9 + c399536 commit e26a818

6 files changed

Lines changed: 35 additions & 39 deletions

File tree

.pre-commit-hooks.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
description: Shell source code formatter (build from source)
1515
language: golang
1616
# Note: keep Go version in `go.mod` in sync with shfmt's required Go version
17-
additional_dependencies: [mvdan.cc/sh/v3/cmd/shfmt@v3.12.0]
17+
additional_dependencies: [mvdan.cc/sh/v3/cmd/shfmt@v3.13.0]
1818
entry: shfmt
1919
args: [--write]
2020
types: [shell]
@@ -27,7 +27,7 @@
2727
description: Shell source code formatter (Docker image)
2828
language: docker_image
2929
# Note: use the top level multiplatform image digest here
30-
entry: --net none mvdan/shfmt:v3.12.0@sha256:307d265ffd25ce832899ae17c93ed5062fc3375c514bba8f52cbf52792735c4d
30+
entry: --net none mvdan/shfmt:v3.13.0@sha256:cb551dbf13a0e9a017e9c89647bcd4da3b1bd71eb16c6dc7588d2593a9b4611a
3131
args: [--write]
3232
types: [shell]
3333
exclude_types: [csh, tcsh, zsh]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Usage in `.pre-commit-config.yaml`:
1212

1313
```yaml
1414
- repo: https://github.com/scop/pre-commit-shfmt
15-
rev: v3.12.0-2
15+
rev: v3.13.0-1
1616
hooks:
1717
# Choose one of:
1818
- id: shfmt # prebuilt upstream executable

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/scop/pre-commit-shfmt/v3
22

3-
go 1.23
3+
go 1.25.0

setup.cfg

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = shfmt_py
3-
version = 3.12.0-2
3+
version = 3.13.0-1
44
description = Shell source code formatter
55
url = https://github.com/scop/pre-commit-shfmt
66
# shfmt proper and Python packaging related files
@@ -25,47 +25,47 @@ download_scripts =
2525
[shfmt]
2626
group = shfmt-binary
2727
marker = sys_platform == "darwin" and platform_machine == "x86_64"
28-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_darwin_amd64
29-
sha256 = c31548693de6584e6164b7ed5fbb7b4a083f2d937ca94b4e0ddf59aa461a85e4
28+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_darwin_amd64
29+
sha256 = b6890a0009abf71d36d7c536ad56e3132c547ceb77cd5d5ee62b3469ab4e9417
3030
[shfmt]
3131
group = shfmt-binary
3232
marker = sys_platform == "darwin" and platform_machine == "arm64"
33-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_darwin_arm64
34-
sha256 = d903802e0ce3ecbc82b98512f55ba370b0d37a93f3f78de394f5b657052b33dd
33+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_darwin_arm64
34+
sha256 = 650970603b5946dc6041836ddcfa7a19d99b5da885e4687f64575508e99cf718
3535
[shfmt]
3636
group = shfmt-binary
3737
# TODO: verify i386
3838
marker = sys_platform == "linux" and platform_machine == "i386"
3939
marker = sys_platform == "linux" and platform_machine == "i686"
40-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_linux_386
41-
sha256 = 6b67da16834a215cc8c565bfbcfaa0303809456d8cafad28cb2eeea35a88904d
40+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_linux_386
41+
sha256 = e645b59e34928442853fb5610dc485985f8acbe112a129679cede1dc320e54ff
4242
[shfmt]
4343
group = shfmt-binary
4444
marker = sys_platform == "linux" and platform_machine == "x86_64"
45-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_linux_amd64
46-
sha256 = d9fbb2a9c33d13f47e7618cf362a914d029d02a6df124064fff04fd688a745ea
45+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_linux_amd64
46+
sha256 = 70aa99784703a8d6569bbf0b1e43e1a91906a4166bf1a79de42050a6d0de7551
4747
[shfmt]
4848
group = shfmt-binary
4949
# TODO: verify armv6hf
5050
marker = sys_platform == "linux" and platform_machine == "armv6hf"
5151
marker = sys_platform == "linux" and platform_machine == "armv7l"
52-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_linux_arm
53-
sha256 = a93c1ed5be25ce9dd0fd62c4cf0af7453740d234725877b973e6c6a8c7598500
52+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_linux_arm
53+
sha256 = 774b9a86cff4844179328cfbab2f602e75dcb68132e918e5271d015b3295c9c7
5454
[shfmt]
5555
group = shfmt-binary
5656
marker = sys_platform == "linux" and platform_machine == "aarch64"
57-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_linux_arm64
58-
sha256 = 5f3fe3fa6a9f766e6a182ba79a94bef8afedafc57db0b1ad32b0f67fae971ba4
57+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_linux_arm64
58+
sha256 = 2091a31afd47742051a77bf7cfd175533ab07e924c20ef3151cd108fa1cab5b0
5959
[shfmt.exe]
6060
group = shfmt-binary
6161
# TODO: verify both
6262
marker = sys_platform == "win32" and platform_machine == "x86"
6363
marker = sys_platform == "cygwin" and platform_machine == "i386"
64-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_windows_386.exe
65-
sha256 = 92c1ef0af344a10f2cefe3ce4bc6793ae8b3719ac08fc01802bbd8eae105e534
64+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_windows_386.exe
65+
sha256 = f3e32b2a320a3053837add32803d7fb3b730d3f10b84a867d327a549ef068fa0
6666
[shfmt.exe]
6767
group = shfmt-binary
6868
marker = sys_platform == "win32" and platform_machine == "AMD64"
6969
marker = sys_platform == "cygwin" and platform_machine == "x86_64"
70-
url = https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_windows_amd64.exe
71-
sha256 = c8bda517ba1c640ce4a715c0fa665439ddbe4357ba5e9b77b0e51e70e2b9c94b
70+
url = https://github.com/mvdan/sh/releases/download/v3.13.0/shfmt_v3.13.0_windows_amd64.exe
71+
sha256 = 62241aaf6b0ca236f8625d8892784b73fa67ad40bc677a1ad1a64ae395f6a7d5

tools/generate_pre_commit_hooks.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
description: Shell source code formatter (prebuilt upstream executable)
1414
language: python
1515
entry: shfmt
16-
args: [-w, -s]
16+
args: [--write]
1717
types: [shell]
18-
exclude_types: [csh, tcsh, zsh]
18+
exclude_types: [csh, tcsh]
1919
stages: [pre-commit, pre-merge-commit, pre-push, manual]
2020
minimum_pre_commit_version: 3.2.0 # for "stages" names
2121
@@ -26,9 +26,9 @@
2626
# Note: keep Go version in `go.mod` in sync with shfmt's required Go version
2727
additional_dependencies: [mvdan.cc/sh/v3/cmd/shfmt@${shfmt_tag}]
2828
entry: shfmt
29-
args: [-w, -s]
29+
args: [--write]
3030
types: [shell]
31-
exclude_types: [csh, tcsh, zsh]
31+
exclude_types: [csh, tcsh]
3232
stages: [pre-commit, pre-merge-commit, pre-push, manual]
3333
minimum_pre_commit_version: 3.2.0 # for "stages" names
3434
@@ -38,9 +38,9 @@
3838
language: docker_image
3939
# Note: use the top level multiplatform image digest here
4040
entry: --net none mvdan/shfmt:${shfmt_tag}@${docker_image_digest}
41-
args: [-w, -s]
41+
args: [--write]
4242
types: [shell]
43-
exclude_types: [csh, tcsh, zsh]
43+
exclude_types: [csh, tcsh]
4444
stages: [pre-commit, pre-merge-commit, pre-push, manual]
4545
minimum_pre_commit_version: 3.2.0 # for "stages" names
4646
"""

tools/generate_setup_cfg.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,23 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818

19+
import json
1920
import re
2021
import string
22+
import subprocess
2123
import sys
2224
from urllib.parse import quote as urlquote, urljoin
23-
from urllib.request import urlopen
2425

2526
setup_cfg_template = """
2627
[metadata]
2728
name = shfmt_py
2829
version = ${python_pkg_version}
2930
description = Shell source code formatter
3031
url = https://github.com/scop/pre-commit-shfmt
31-
# license here is for shfmt proper; Python packaging related files may have others, see their contents and classifiers below
32-
license = BSD 3-Clause
32+
# shfmt proper and Python packaging related files
33+
license = BSD 3-Clause AND Apache Software License AND MIT License
3334
classifiers =
3435
Intended Audience :: Developers
35-
License :: OSI Approved :: Apache Software License
36-
License :: OSI Approved :: BSD License
37-
License :: OSI Approved :: MIT License
3836
Operating System :: MacOS
3937
Operating System :: Microsoft :: Windows
4038
Operating System :: POSIX :: Linux
@@ -118,12 +116,10 @@ def main(python_pkg_tag: str) -> None:
118116
data = {
119117
"python_pkg_version": python_pkg_tag.lstrip("v"),
120118
}
121-
url = urljoin(base_url, "sha256sums.txt")
122-
hexdigests = {}
123-
with urlopen(url) as f:
124-
for line in f:
125-
if m := re.search(r"^([0-9a-f]{64})\s+(\S+)$", line.decode()):
126-
hexdigests[m.group(2)] = m.group(1)
119+
result = subprocess.run(["gh", "release", "view", "--repo", "mvdan/sh", main_tag, "--json", "assets"], stdout=subprocess.PIPE, check=True)
120+
assets = json.loads(result.stdout).get("assets", [])
121+
hexdigests = {asset["name"]: asset["digest"].removeprefix("sha256:") for asset in assets if asset["digest"].startswith("sha256:")}
122+
127123
for fn in release_files:
128124
if m := re.search(r"_([a-z0-9]+_[a-z0-9]+)(?:\.exe)?$", fn):
129125
os_arch = m.group(1)

0 commit comments

Comments
 (0)