Skip to content

Commit fb2efd1

Browse files
committed
chore: try new version of sh-syntax
1 parent 20a9dae commit fb2efd1

9 files changed

Lines changed: 78 additions & 38 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ jobs:
4141
- name: Build, Lint and Test
4242
run: |
4343
yarn build
44-
yarn lint
45-
yarn test
44+
yarn run-p lint test typecov
4645
env:
47-
NODE_OPTIONS: --max-old-space-size=12288
4846
PARSER_NO_WATCH: true
4947

5048
- name: Codecov

‎.size-limit.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"path": "packages/autocorrect/lib/index.js",
4+
"limit": "540B"
5+
},
6+
{
7+
"path": "packages/pkg/lib/index.js",
8+
"limit": "450B"
9+
},
10+
{
11+
"path": "packages/sh/lib/index.js",
12+
"limit": "3.2kB"
13+
},
14+
{
15+
"path": "packages/sql/lib/index.js",
16+
"limit": "2.5kB"
17+
}
18+
]

‎package.json‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,6 @@
9797
"markuplint": {
9898
"extends": "@1stg"
9999
},
100-
"size-limit": [
101-
{
102-
"path": "packages/autocorrect/lib/index.js",
103-
"limit": "540B"
104-
},
105-
{
106-
"path": "packages/pkg/lib/index.js",
107-
"limit": "450B"
108-
},
109-
{
110-
"path": "packages/sh/lib/index.js",
111-
"limit": "2.4kB"
112-
},
113-
{
114-
"path": "packages/sql/lib/index.js",
115-
"limit": "2.5kB"
116-
}
117-
],
118100
"typeCoverage": {
119101
"atLeast": 100,
120102
"cache": true,

‎packages/sh/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"prettier": "^3.0.3"
5151
},
5252
"dependencies": {
53-
"sh-syntax": "^0.5.3"
53+
"sh-syntax": "https://pkg.csb.dev/un-ts/sh-syntax/commit/418a03c4/sh-syntax/_pkg.tgz"
5454
},
5555
"devDependencies": {
5656
"@types/common-tags": "^1.8.4",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`fatal parse error with meaningful message 1`] = `
4+
[SyntaxError: a command can only contain words and redirects; encountered )
5+
> 1 | echo )
6+
| ^]
7+
`;

‎packages/sh/test/__snapshots__/fixtures.spec.ts.snap‎

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,38 @@ main "$@"
218218
"
219219
`;
220220
221-
exports[`parser and printer > should format all fixtures > 146.ini 1`] = `"; can only immediately follow a statement"`;
221+
exports[`parser and printer > should format all fixtures > 146.ini 1`] = `
222+
"; can only immediately follow a statement
223+
6 | disallow_untyped_defs = True
224+
7 | disallow_any_generics = True
225+
> 8 | ; disallow_any_unimported = True
226+
| ^
227+
9 | ; warn_redundant_casts = True
228+
10 | ; warn_return_any = True
229+
11 | ; warn_unused_configs = True"
230+
`;
222231
223-
exports[`parser and printer > should format all fixtures > 147.cfg 1`] = `"a command can only contain words and redirects; encountered ("`;
232+
exports[`parser and printer > should format all fixtures > 147.cfg 1`] = `
233+
"a command can only contain words and redirects; encountered (
234+
31 | Operating System :: OS Independent
235+
32 |
236+
> 33 | License :: OSI Approved :: GNU General Public License v3 (GPLv3)
237+
| ^
238+
34 |
239+
35 | Programming Language :: Python
240+
36 | Programming Language :: Python :: 3"
241+
`;
224242
225-
exports[`parser and printer > should format all fixtures > 148.ini 1`] = `"reached EOF without closing quote '"`;
243+
exports[`parser and printer > should format all fixtures > 148.ini 1`] = `
244+
"reached EOF without closing quote '
245+
33 | ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working:DeprecationWarning
246+
34 | ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working:DeprecationWarning
247+
> 35 | ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working:DeprecationWarning
248+
| ^
249+
36 | junit_duration_report = call
250+
37 | # Our github annotation parser from .github/workflows/tox.yml requires xunit1 format. Ref:
251+
38 | # https://github.com/shyim/junit-report-annotations-action/issues/3#issuecomment-663241378"
252+
`;
226253
227254
exports[`parser and printer > should format all fixtures > 162.sh 1`] = `
228255
"#!/usr/bin/env bash
@@ -842,9 +869,22 @@ esac
842869
"
843870
`;
844871
845-
exports[`parser and printer > should format all fixtures > 278.Dockerfile 1`] = `""foo(" must be followed by )"`;
872+
exports[`parser and printer > should format all fixtures > 278.Dockerfile 1`] = `
873+
""foo(" must be followed by )
874+
1 | FROM ubuntu
875+
2 |
876+
> 3 | RUN (cd out && ls)
877+
| ^
878+
4 |"
879+
`;
846880
847-
exports[`parser and printer > should format all fixtures > 292.Dockerfile 1`] = `""then" can only be used in an if"`;
881+
exports[`parser and printer > should format all fixtures > 292.Dockerfile 1`] = `
882+
""then" can only be used in an if
883+
1 | FROM node:20.9.0-alpine
884+
> 2 | RUN if [[ x$LATEST_NPM = xtrue ]]; then yarn global add npm@latest; fi
885+
| ^
886+
3 |"
887+
`;
848888
849889
exports[`parser and printer > should format all fixtures > Dockerfile 1`] = `
850890
"FROM node:lts-alpine as builder

‎packages/sh/test/error.spec.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,5 @@ test('fatal parse error with meaningful message', async () => {
1111
plugins: [ShPlugin],
1212
}),
1313
)
14-
await rejects.toThrow(SyntaxError)
15-
await rejects.toThrow(
16-
'a command can only contain words and redirects; encountered )',
17-
)
14+
await rejects.toThrowErrorMatchingSnapshot()
1815
})

‎packages/sh/test/fixtures.spec.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ describe('parser and printer', () => {
2323

2424
expect(output).toMatchSnapshot(relativeFilepath)
2525
} catch (err: unknown) {
26-
expect((err as Error).message.split('\n').at(0)).toMatchSnapshot(
27-
relativeFilepath,
28-
)
26+
expect((err as Error).message).toMatchSnapshot(relativeFilepath)
2927
}
3028
}
3129
})

‎yarn.lock‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14022,7 +14022,7 @@ __metadata:
1402214022
dependencies:
1402314023
"@types/common-tags": "npm:^1.8.4"
1402414024
common-tags: "npm:^1.8.2"
14025-
sh-syntax: "npm:^0.5.3"
14025+
sh-syntax: "https://pkg.csb.dev/un-ts/sh-syntax/commit/418a03c4/sh-syntax/_pkg.tgz"
1402614026
peerDependencies:
1402714027
prettier: ^3.0.3
1402814028
languageName: unknown
@@ -15891,12 +15891,12 @@ __metadata:
1589115891
languageName: node
1589215892
linkType: hard
1589315893

15894-
"sh-syntax@npm:^0.5.3":
15894+
"sh-syntax@https://pkg.csb.dev/un-ts/sh-syntax/commit/418a03c4/sh-syntax/_pkg.tgz":
1589515895
version: 0.5.3
15896-
resolution: "sh-syntax@npm:0.5.3"
15896+
resolution: "sh-syntax@https://pkg.csb.dev/un-ts/sh-syntax/commit/418a03c4/sh-syntax/_pkg.tgz"
1589715897
dependencies:
1589815898
tslib: "npm:^2.8.1"
15899-
checksum: 10c0/540cdd1a883997492ff5d117bc8d4f77916d6abba68188067b0feb55c34f834f94649675bf66d17b0a72868fe705e0ae5855af68308d546ce108dd59a98cc3c5
15899+
checksum: 10c0/a9f4d246112164a7c9d4de5354046378c8f61b7af93e60dde3e169b75b1745bc978326acb6ab8f4cfb819e0a2aaab045d062aa36c8c9ba35ed1ddfff34413956
1590015900
languageName: node
1590115901
linkType: hard
1590215902

0 commit comments

Comments
 (0)