Skip to content

Commit 4117b37

Browse files
committed
Update dependencies
1 parent bc165d6 commit 4117b37

4 files changed

Lines changed: 53 additions & 48 deletions

File tree

Dockerfile

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM alpine:3.20.3 AS entry
4-
RUN apk add --no-cache npm && npm install -g typescript@5.6.3 @types/node@22.9.0
3+
FROM alpine:3.23.2 AS entry
4+
RUN apk add --no-cache npm && npm install -g typescript@5.9.3 @types/node@25.0.9
55
COPY entry.ts .
66
RUN tsc \
77
--noUnusedLocals \
@@ -16,7 +16,7 @@ RUN tsc \
1616
# eclipse-temurin:21-alpine java --list-modules`, then removing modules by trial
1717
# and error until `make test` throws ClassNotFoundException. When first
1818
# implemented, this custom JRE reduced our image size from 574 MB to 469 MB
19-
FROM amazoncorretto:21.0.6-alpine3.21 AS jre
19+
FROM amazoncorretto:21.0.9-alpine3.22 AS jre
2020
RUN apk add binutils && jlink \
2121
--add-modules java.se,jdk.compiler,jdk.unsupported \
2222
--compress zip-6 \
@@ -25,7 +25,7 @@ RUN apk add binutils && jlink \
2525
--output /jre \
2626
--strip-debug
2727

28-
FROM alpine:3.20.3
28+
FROM alpine:3.23.2
2929
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
3030
ENV PIP_NO_CACHE_DIR=1
3131
RUN <<EOF
@@ -46,7 +46,7 @@ apk add --no-cache \
4646
pip3 install --break-system-packages \
4747
autoflake==1.7.8 \
4848
isort==5.13.2 \
49-
ruff==0.7.3 \
49+
ruff==0.14.13 \
5050
PyYAML>=6.0
5151

5252
# Install Python dependencies
@@ -71,39 +71,39 @@ chmod +x /usr/bin/black21
7171
# https://nodejs.org/en/blog/announcements/v22-release-announce#support-requireing-synchronous-esm-graphs
7272
# https://github.com/eslint/eslint/issues/13684#issuecomment-722949152
7373
npm install -g \
74-
@prettier/plugin-xml@3.4.1 \
75-
eslint@9.23.0 \
76-
eslint-plugin-jsdoc@50.6.9 \
74+
@prettier/plugin-xml@3.4.2 \
75+
eslint@9.39.2 \
76+
eslint-plugin-jsdoc@62.0.0 \
7777
eslint-plugin-sort-keys@2.3.5 \
7878
eslint-plugin-unicorn@56.0.1 \
79-
prettier@3.5.3 \
80-
svgo@3.3.2 \
81-
typescript-eslint@8.29.0
79+
prettier@3.8.0 \
80+
svgo@4.0.0 \
81+
typescript-eslint@8.53.1
8282

8383
# Install Scala dependencies
84-
wget https://github.com/coursier/coursier/releases/download/v2.1.17/coursier -O /bin/coursier
84+
wget https://github.com/coursier/coursier/releases/download/v2.1.24/coursier -O /bin/coursier
8585
chmod +x /bin/coursier
86-
coursier bootstrap org.scalameta:scalafmt-cli_2.13:3.8.3 \
86+
coursier bootstrap org.scalameta:scalafmt-cli_2.13:3.10.4 \
8787
-r sonatype:snapshots --main org.scalafmt.cli.Cli \
8888
--standalone \
8989
-o scalafmt
9090

9191
# Install static binaries
92-
wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-32d3ac78/clang-format-18_linux-amd64 -O clang-format
92+
wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-796e77c/clang-format-20_linux-amd64 -O clang-format
9393
chmod +x clang-format
94-
wget https://github.com/google/google-java-format/releases/download/v1.24.0/google-java-format-1.24.0-all-deps.jar -O google-java-format
95-
wget https://search.maven.org/remotecontent?filepath=com/facebook/ktfmt/0.53/ktfmt-0.53-jar-with-dependencies.jar -O ktfmt
96-
wget https://repo1.maven.org/maven2/com/squareup/sort-gradle-dependencies-app/0.14/sort-gradle-dependencies-app-0.14-all.jar -O gradle-dependencies-sorter
97-
wget https://github.com/mvdan/sh/releases/download/v3.10.0/shfmt_v3.10.0_linux_amd64 -O shfmt
94+
wget https://github.com/google/google-java-format/releases/download/v1.33.0/google-java-format-1.33.0-all-deps.jar -O google-java-format
95+
wget https://repo1.maven.org/maven2/com/facebook/ktfmt/0.61/ktfmt-0.61-with-dependencies.jar -O ktfmt
96+
wget https://repo1.maven.org/maven2/com/squareup/sort-gradle-dependencies-app/0.16/sort-gradle-dependencies-app-0.16-all.jar -O gradle-dependencies-sorter
97+
wget https://github.com/mvdan/sh/releases/download/v3.12.0/shfmt_v3.12.0_linux_amd64 -O shfmt
9898
chmod +x shfmt
99-
wget https://github.com/tamasfe/taplo/releases/download/0.9.3/taplo-linux-x86_64.gz -O taplo.gz
99+
wget https://github.com/tamasfe/taplo/releases/download/0.10.0/taplo-linux-x86_64.gz -O taplo.gz
100100
gzip -d taplo.gz
101101
chmod +x taplo
102-
wget https://releases.hashicorp.com/terraform/1.9.8/terraform_1.9.8_linux_amd64.zip -O tf.zip
102+
wget https://releases.hashicorp.com/terraform/1.14.3/terraform_1.14.3_linux_amd64.zip -O tf.zip
103103
unzip tf.zip
104104
rm tf.zip
105105
rm LICENSE.txt
106-
wget https://releases.hashicorp.com/packer/1.14.2/packer_1.14.2_linux_amd64.zip -O packer.zip
106+
wget https://releases.hashicorp.com/packer/1.14.3/packer_1.14.3_linux_amd64.zip -O packer.zip
107107
unzip packer.zip
108108
rm packer.zip
109109

@@ -114,16 +114,16 @@ touch /emptyfile
114114
apk del .build-deps
115115
rm -rf \
116116
/bin/coursier \
117-
/black21-venv/lib/python3.11/site-packages/pip \
118-
/black21-venv/lib/python3.11/site-packages/pkg_resources \
119-
/black21-venv/lib/python3.11/site-packages/setuptools \
117+
/black21-venv/lib/python3.12/site-packages/pip \
118+
/black21-venv/lib/python3.12/site-packages/pkg_resources \
119+
/black21-venv/lib/python3.12/site-packages/setuptools \
120120
/root/.cache \
121121
/root/.npm \
122122
/usr/bin/lto-dump \
123123
/var/cache
124124
EOF
125125
# https://stackoverflow.com/a/59485924
126-
COPY --from=golang:1.23.3-alpine3.20 /usr/local/go/bin/gofmt /gofmt
126+
COPY --from=golang:1.25.6-alpine3.23 /usr/local/go/bin/gofmt /gofmt
127127
ENV PATH="/jre/bin:${PATH}"
128128
COPY --from=jre /jre /jre
129129
COPY . .

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ This repo contains [pre-commit](https://pre-commit.com/) hooks for Duolingo deve
66

77
The main hook that runs several code formatters in parallel:
88

9-
- [Prettier](https://github.com/prettier/prettier) v3.5.3 for CSS, HTML, JS, JSX, Markdown, Sass, TypeScript, XML, YAML
10-
- [ESLint](https://eslint.org/) v9.23.0 for JS, TypeScript
11-
- [Ruff](https://docs.astral.sh/ruff/) v0.7.3 for Python 3
9+
- [Prettier](https://github.com/prettier/prettier) v3.8.0 for CSS, HTML, JS, JSX, Markdown, Sass, TypeScript, XML, YAML
10+
- [ESLint](https://eslint.org/) v9.39.2 for JS, TypeScript
11+
- [Ruff](https://docs.astral.sh/ruff/) v0.14.13 for Python 3
1212
- [Black](https://github.com/psf/black) v21.12b0 for Python 2
1313
- [autoflake](https://github.com/myint/autoflake) v1.7.8 for Python <!-- TODO: Upgrade to v2+, restrict to Python 2, and reenable Ruff rule F401 once our Python 3 repos that were converted from Python 2 no longer use type hint comments: https://github.com/PyCQA/autoflake/issues/222#issuecomment-1419089254 -->
1414
- [isort](https://github.com/PyCQA/isort) v5.13.2 for Python 2
15-
- [google-java-format](https://github.com/google/google-java-format) v1.24.0 for Java
16-
- [ktfmt](https://github.com/facebookincubator/ktfmt) v0.53 for Kotlin
17-
- [gradle-dependencies-sorter](https://github.com/square/gradle-dependencies-sorter) v0.14 for Gradle Kotlin
18-
- [gofmt](https://pkg.go.dev/cmd/gofmt) v1.23.3 for Go
19-
- [scalafmt](https://scalameta.org/scalafmt/) v3.8.3 for Scala
20-
- [shfmt](https://github.com/mvdan/sh) v3.10.0 for Shell
21-
- [xsltproc](http://www.xmlsoft.org/xslt/xsltproc.html) from libxslt v10139 for XML
22-
- [terraform fmt](https://github.com/hashicorp/terraform) v1.9.8 for Terraform
23-
- [packer fmt](https://github.com/hashicorp/packer) v1.14.2 for Packer
24-
- [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) v18.1.8 for C++, Protobuf
25-
- [SVGO](https://github.com/svg/svgo) v3.3.2 for SVG
26-
- [Taplo](https://taplo.tamasfe.dev/) v0.9.3 for TOML
15+
- [google-java-format](https://github.com/google/google-java-format) v1.33.0 for Java
16+
- [ktfmt](https://github.com/facebookincubator/ktfmt) v0.61 for Kotlin
17+
- [gradle-dependencies-sorter](https://github.com/square/gradle-dependencies-sorter) v0.16 for Gradle Kotlin
18+
- [gofmt](https://pkg.go.dev/cmd/gofmt) v1.25.6 for Go
19+
- [scalafmt](https://scalameta.org/scalafmt/) v3.10.4 for Scala
20+
- [shfmt](https://github.com/mvdan/sh) v3.12.0 for Shell
21+
- [xsltproc](http://www.xmlsoft.org/xslt/xsltproc.html) from libxslt v10143 for XML
22+
- [terraform fmt](https://github.com/hashicorp/terraform) v1.14.3 for Terraform
23+
- [packer fmt](https://github.com/hashicorp/packer) v1.14.3 for Packer
24+
- [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) v20.1.0 for C++, Protobuf
25+
- [SVGO](https://github.com/svg/svgo) v4.0.0 for SVG
26+
- [Taplo](https://taplo.tamasfe.dev/) v0.10.0 for TOML
2727
- Custom regex transformations (basically [sed](https://en.wikipedia.org/wiki/Sed)), for example:
2828
- Trimming trailing whitespace and newlines
2929
- Removing unnecessary `coding` pragmas and `object` base classes in Python 3

entry.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const PRETTIER_OPTIONS = [
2424
"/tmp/prettier-cache",
2525
"--end-of-line",
2626
"auto",
27+
"--experimental-cli",
2728
"--ignore-path",
2829
EMPTY_FILE,
2930
"--log-level",
@@ -87,8 +88,9 @@ const enum HookName {
8788
Isort = "isort",
8889
Ktfmt = "ktfmt",
8990
PackerFmt = "packer fmt",
91+
Prettier = "Prettier",
9092
PrettierJs = "Prettier (JS)",
91-
PrettierNonJs = "Prettier (non-JS)",
93+
PrettierXml = "Prettier (XML)",
9294
Ruff = "Ruff",
9395
Scalafmt = "scalafmt",
9496
Sed = "sed",
@@ -251,6 +253,11 @@ const HOOKS: Record<HookName, Hook> = {
251253
include: /\.pkr\.hcl$/,
252254
runAfter: [HookName.Sed],
253255
},
256+
[HookName.Prettier]: {
257+
action: sources => run("prettier", ...PRETTIER_OPTIONS, ...sources),
258+
include: /\.(css|html?|markdown|md|scss|tsx?|ya?ml)$/,
259+
runAfter: [HookName.Sed, HookName.EsLint],
260+
},
254261
[HookName.PrettierJs]: {
255262
action: sources =>
256263
run(
@@ -264,7 +271,7 @@ const HOOKS: Record<HookName, Hook> = {
264271
include: /\.jsx?$/,
265272
runAfter: [HookName.Sed, HookName.EsLint],
266273
},
267-
[HookName.PrettierNonJs]: {
274+
[HookName.PrettierXml]: {
268275
action: sources =>
269276
run(
270277
"prettier",
@@ -274,8 +281,8 @@ const HOOKS: Record<HookName, Hook> = {
274281
"/usr/local/lib/node_modules/@prettier/plugin-xml/src/plugin.js",
275282
...sources,
276283
),
277-
include: /\.(css|html?|markdown|md|scss|tsx?|xml|ya?ml)$/,
278-
runAfter: [HookName.Sed, HookName.Xsltproc, HookName.EsLint],
284+
include: /\.xml$/,
285+
runAfter: [HookName.Sed, HookName.Xsltproc],
279286
},
280287
[HookName.Ruff]: {
281288
action: async (sources, args) => {

ruff.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ target-version = "py37"
55

66
[lint]
77
ignore = [
8-
# This rule causes Ruff to warn "The following rule may cause conflicts when
9-
# used with the formatter". TODO: Remove after updating to Ruff v0.9?
10-
# https://github.com/astral-sh/ruff/issues/8272#issuecomment-2580594913
11-
"ISC001",
128
# We disable Ruff's `unused-import` for now in favor of autoflake <2 because
139
# the latter preserves imports that are unused in code but "used" in type
1410
# hint comments. Ruff also seems to have an unfortunate bug: it can end up
@@ -19,6 +15,8 @@ ignore = [
1915
"SIM101",
2016
# This rule correctly preserves logic but will delete comments :|
2117
"SIM114",
18+
# This rule adds visual noise and hurts readability/greppability
19+
"SIM905",
2220
]
2321
# https://docs.astral.sh/ruff/rules/
2422
select = [

0 commit comments

Comments
 (0)