Skip to content

Commit 39d9d51

Browse files
committed
Merge branch 'master' of https://github.com/Automattic/harper into dictionary-curation-2025-03-06
2 parents 1e30b2c + bca2818 commit 39d9d51

File tree

124 files changed

+25914
-20588
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+25914
-20588
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target
2+
build
3+
*.pdf
4+
node_modules

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ updates:
55
schedule:
66
interval: "weekly"
77
- package-ecosystem: "npm"
8-
directory: "/packages"
8+
directory: "/"
99
schedule:
1010
interval: "weekly"

.github/workflows/package_vscode_plugin.yml

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
- uses: actions/setup-node@v4
3737
with:
3838
node-version-file: ".node-version"
39+
- name: Enable Corepack
40+
run: corepack enable
3941
- name: Build harper-ls
4042
uses: houseabsolute/actions-rust-cross@v1
4143
with:

.github/workflows/package_wp_plugin.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
- uses: actions/setup-node@v4
2020
with:
2121
node-version-file: ".node-version"
22+
- name: Enable Corepack
23+
run: corepack enable
2224
- name: Install `pandoc`
2325
run: sudo apt-get update && sudo apt-get install pandoc -y
2426
- name: Install `wasm-pack`

.github/workflows/precommit.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
- uses: actions/setup-node@v4
2222
with:
2323
node-version-file: ".node-version"
24+
- name: Enable Corepack
25+
run: corepack enable
2426
- name: Install `pandoc`
2527
run: sudo apt-get update && sudo apt-get install pandoc -y
2628
- name: Install `wasm-pack`

.github/workflows/release_vscode_plugin.yml

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
- uses: actions/setup-node@v4
3535
with:
3636
node-version-file: ".node-version"
37+
- name: Enable Corepack
38+
run: corepack enable
3739
- name: Build harper-ls
3840
uses: houseabsolute/actions-rust-cross@v1
3941
with:

.github/workflows/release_wp_plugin.yml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
- uses: actions/setup-node@v4
1818
with:
1919
node-version-file: ".node-version"
20+
- name: Enable Corepack
21+
run: corepack enable
2022
- name: Install `pandoc`
2123
run: sudo apt-get update && sudo apt-get install pandoc -y
2224
- name: Install `wasm-pack`

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
target
22
build
33
*.pdf
4+
node_modules

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry=https://registry.npmjs.org

.vscode/extensions.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"recommendations": [
3-
"elijah-potter.harper"
4-
]
5-
}
2+
"recommendations": ["elijah-potter.harper", "biomejs.biome"]
3+
}

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"typescript.tsdk": "packages/harper.js/node_modules/typescript/lib"
2+
"typescript.tsdk": "node_modules/typescript/lib"
33
}

Cargo.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NODE_VERSION=slim
22

33
FROM rust:latest AS wasm-build
4-
RUN rustup toolchain install stable-x86_64-unknown-linux-gnu
4+
RUN rustup toolchain install
55

66
RUN mkdir -p /usr/build/
77
WORKDIR /usr/build/
@@ -16,34 +16,31 @@ RUN wasm-pack build --release --target web
1616
FROM node:${NODE_VERSION} AS node-build
1717

1818
RUN apt-get update && apt-get install git pandoc -y
19+
RUN corepack enable
1920

2021
RUN mkdir -p /usr/build/
2122
WORKDIR /usr/build/
2223

23-
RUN mkdir harper-wasm
24-
24+
COPY . .
2525
COPY --from=wasm-build /usr/build/harper-wasm/pkg /usr/build/harper-wasm/pkg
26-
COPY packages packages
27-
COPY demo.md .
26+
27+
RUN pnpm install
2828

2929
WORKDIR /usr/build/packages/harper.js
3030

31-
RUN yarn install && yarn build && ./docs.sh
31+
RUN pnpm build && ./docs.sh
3232

3333
WORKDIR /usr/build/packages/web
3434

35-
RUN yarn install && yarn build
35+
RUN pnpm build
3636

3737
FROM node:${NODE_VERSION}
3838

39-
COPY --from=node-build /usr/build/packages/web/build /usr/build/packages/web/build
40-
COPY --from=node-build /usr/build/packages/web/package.json /usr/build/packages/web/package.json
41-
42-
WORKDIR /usr/build/packages/web
39+
COPY --from=node-build /usr/build/packages/web/build /usr/build
4340

44-
RUN yarn install
41+
WORKDIR /usr/build
4542

4643
ENV HOST=0.0.0.0
4744
ENV PORT=3000
4845

49-
ENTRYPOINT ["node", "build"]
46+
ENTRYPOINT ["node", "index"]

biome.json

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": true,
10+
"include": ["packages/**/*", "**/*.json"],
11+
"ignore": [
12+
"node_modules",
13+
"dist",
14+
"target",
15+
"build",
16+
"temp",
17+
"*.zip",
18+
"**/*.rs",
19+
"harper-wasm/pkg",
20+
".vscode-test",
21+
".svelte-kit",
22+
".sveltepress",
23+
"packages/obsidian-plugin/main.js",
24+
"pnpm-lock.yaml",
25+
"package-lock.json",
26+
"yarn.lock"
27+
]
28+
},
29+
"formatter": {
30+
"enabled": true,
31+
"lineWidth": 100,
32+
"indentStyle": "tab",
33+
"useEditorconfig": true
34+
},
35+
"organizeImports": {
36+
"enabled": true
37+
},
38+
"linter": {
39+
"enabled": true,
40+
"rules": {
41+
"recommended": true,
42+
"suspicious": {
43+
"noExplicitAny": "off",
44+
"noArrayIndexKey": "off",
45+
"noLabelVar": "warn"
46+
},
47+
"a11y": {
48+
"noSvgWithoutTitle": "off",
49+
"useGenericFontNames": "warn"
50+
},
51+
"correctness": {
52+
"useExhaustiveDependencies": "off"
53+
},
54+
"style": {
55+
"noParameterAssign": "off",
56+
"noArguments": "off",
57+
"noNonNullAssertion": "off",
58+
"noUselessElse": "off",
59+
"useNodejsImportProtocol": "off"
60+
},
61+
"complexity": {
62+
"noForEach": "off",
63+
"noStaticOnlyClass": "off",
64+
"noThisInStatic": "off"
65+
}
66+
}
67+
},
68+
"javascript": {
69+
"formatter": {
70+
"quoteStyle": "single"
71+
}
72+
},
73+
"overrides": [
74+
{
75+
"include": ["*.svelte", "*.astro", "*.vue"],
76+
"linter": {
77+
"rules": {
78+
"style": {
79+
"useConst": "off",
80+
"useImportType": "off"
81+
}
82+
}
83+
}
84+
}
85+
]
86+
}

harper-cli/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ repository = "https://github.com/automattic/harper"
99
[dependencies]
1010
anyhow = "1.0.97"
1111
ariadne = "0.4.1"
12-
clap = { version = "4.5.31", features = ["derive"] }
12+
clap = { version = "4.5.32", features = ["derive"] }
1313
harper-literate-haskell = { path = "../harper-literate-haskell", version = "0.25.0" }
1414
harper-core = { path = "../harper-core", version = "0.25.0" }
1515
harper-comments = { path = "../harper-comments", version = "0.25.0" }
1616
harper-typst = { path = "../harper-typst", version = "0.25.0" }
1717
hashbrown = "0.15.2"
18-
serde = { version = "1.0.218", features = ["derive"] }
18+
serde = { version = "1.0.219", features = ["derive"] }
1919
serde_json = "1.0.140"
2020

2121
[features]

harper-comments/src/masker.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ impl CommentMasker {
2727
|| text.contains("cspell: ignore")
2828
|| text.contains("harper:ignore")
2929
|| text.contains("harper: ignore")
30+
|| text.starts_with("#!")
3031
}),
3132
)
3233
}

harper-comments/tests/language_support.rs

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ create_test!(javadoc_clean_simple.java, 0);
5050
create_test!(javadoc_complex.java, 5);
5151
create_test!(issue_132.rs, 1);
5252
create_test!(laravel_app.php, 2);
53+
create_test!(ignore_shebang_1.sh, 0);
54+
create_test!(ignore_shebang_2.sh, 0);
55+
create_test!(ignore_shebang_3.sh, 0);
56+
create_test!(ignore_shebang_4.sh, 1);
5357

5458
// Checks that some comments are masked out
5559
create_test!(ignore_comments.rs, 1);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
# This is a test to make sure that we don't lint shebang lines.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#! /usr/bin/env sh
2+
# This is a test to make sure that we don't lint shebang lines.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/python3
2+
# This is a test to make sure that we don't lint shebang lines.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#/bin/sh
2+
# This is a test to make sure that we don't ignore invalid shebang lines.

harper-core/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ lazy_static = "1.5.0"
1717
ordered-float = { version = "5.0.0", features = ["serde"] }
1818
paste = "1.0.14"
1919
pulldown-cmark = "0.13.0"
20-
serde = { version = "1.0.218", features = ["derive"] }
20+
serde = { version = "1.0.219", features = ["derive"] }
2121
serde_json = "1.0.140"
2222
smallvec = { version = "1.14.0", features = ["serde"] }
2323
thiserror = "2.0.12"

0 commit comments

Comments
 (0)