Skip to content

Commit cf4d7d4

Browse files
chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)
* chore: adjust prettier config, .gitignore and use taplo to format toml files This brings the plugins-workspace repository to the same code style of the main tauri repo * format toml * ignore examples gen dir * add .vscode/extensions.json * remove packageManager field * fmt * fix audit * taplo ignore permissions autogenerated files * remove create dummy dist * fix prettier workflow * install fmt in prettier workflow --------- Co-authored-by: Lucas Nogueira <[email protected]>
1 parent 72c2ce8 commit cf4d7d4

File tree

227 files changed

+2533
-2504
lines changed

Some content is hidden

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

227 files changed

+2533
-2504
lines changed

.cargo/audit.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ ignore = [
77
# wry needs kuchiki on Android
88
"RUSTSEC-2023-0019",
99
# atty is only used when the `colored` feature is enabled on tauri-plugin-log
10-
"RUSTSEC-2021-0145"
11-
]
10+
"RUSTSEC-2021-0145",
11+
]

.github/workflows/audit-javascript.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ name: Audit JavaScript
77
on:
88
workflow_dispatch:
99
schedule:
10-
- cron: "0 0 * * *"
10+
- cron: '0 0 * * *'
1111
push:
1212
branches:
1313
- v1
1414
- v2
1515
paths:
16-
- ".github/workflows/audit-javascript.yml"
17-
- "**/pnpm-lock.yaml"
18-
- "**/package.json"
16+
- '.github/workflows/audit-javascript.yml'
17+
- '**/pnpm-lock.yaml'
18+
- '**/package.json'
1919
pull_request:
2020
branches:
2121
- v1
2222
- v2
2323
paths:
24-
- ".github/workflows/audit-javascript.yml"
25-
- "**/pnpm-lock.yaml"
26-
- "**/package.json"
24+
- '.github/workflows/audit-javascript.yml'
25+
- '**/pnpm-lock.yaml'
26+
- '**/package.json'
2727

2828
concurrency:
2929
group: ${{ github.workflow }}-${{ github.ref }}
@@ -43,7 +43,7 @@ jobs:
4343
${{ runner.os }}-
4444
- uses: actions/setup-node@v4
4545
with:
46-
node-version: "lts/*"
46+
node-version: 'lts/*'
4747
- uses: pnpm/action-setup@v4
4848
with:
4949
version: 9.x.x

.github/workflows/audit-rust.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ name: Audit Rust
77
on:
88
workflow_dispatch:
99
schedule:
10-
- cron: "0 0 * * *"
10+
- cron: '0 0 * * *'
1111
push:
1212
branches:
1313
- v1
1414
- v2
1515
paths:
16-
- ".github/workflows/audit-rust.yml"
17-
- "**/Cargo.lock"
18-
- "**/Cargo.toml"
16+
- '.github/workflows/audit-rust.yml'
17+
- '**/Cargo.lock'
18+
- '**/Cargo.toml'
1919
pull_request:
2020
branches:
2121
- v1
2222
- v2
2323
paths:
24-
- ".github/workflows/audit-rust.yml"
25-
- "**/Cargo.lock"
26-
- "**/Cargo.toml"
24+
- '.github/workflows/audit-rust.yml'
25+
- '**/Cargo.lock'
26+
- '**/Cargo.toml'
2727

2828
concurrency:
2929
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/check-generated-files.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ name: check generated files
77
on:
88
pull_request:
99
paths:
10-
- ".github/workflows/check-generated-files.yml"
11-
- "**/guest-js/**"
10+
- '.github/workflows/check-generated-files.yml'
11+
- '**/guest-js/**'
1212

1313
concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
@@ -136,7 +136,7 @@ jobs:
136136
${{ runner.os }}-
137137
- uses: actions/setup-node@v4
138138
with:
139-
node-version: "lts/*"
139+
node-version: 'lts/*'
140140
- uses: pnpm/action-setup@v4
141141
with:
142142
version: 9.x.x

.github/workflows/covector-comment-on-fork.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
uses: jbolda/covector/packages/action@covector-v0
2828
with:
2929
token: ${{ secrets.GITHUB_TOKEN }}
30-
command: "status"
30+
command: 'status'

.github/workflows/covector-status.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
uses: jbolda/covector/packages/action@covector-v0
1818
id: covector
1919
with:
20-
command: "status"
20+
command: 'status'
2121
token: ${{ secrets.GITHUB_TOKEN }}
22-
comment: true
22+
comment: true

.github/workflows/covector-version-or-publish.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434

3535
- uses: actions/setup-node@v4
3636
with:
37-
node-version: "lts/*"
38-
registry-url: "https://registry.npmjs.org"
37+
node-version: 'lts/*'
38+
registry-url: 'https://registry.npmjs.org'
3939

4040
- uses: pnpm/action-setup@v4
4141
with:
@@ -65,7 +65,7 @@ jobs:
6565
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
6666
with:
6767
token: ${{ secrets.GITHUB_TOKEN }}
68-
command: "version-or-publish"
68+
command: 'version-or-publish'
6969
createRelease: true
7070
recognizeContributors: true
7171

@@ -78,8 +78,8 @@ jobs:
7878
uses: tauri-apps/create-pull-request@v3
7979
if: steps.covector.outputs.commandRan == 'version'
8080
with:
81-
title: "Publish New Versions (${{ github.ref_name }})"
82-
commit-message: "publish new versions"
83-
labels: "version updates"
84-
branch: "ci/release-${{ github.ref_name }}"
81+
title: 'Publish New Versions (${{ github.ref_name }})'
82+
commit-message: 'publish new versions'
83+
labels: 'version updates'
84+
branch: 'ci/release-${{ github.ref_name }}'
8585
body: ${{ steps.covector.outputs.change }}

.github/workflows/fmt.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2+
# SPDX-License-Identifier: Apache-2.0
3+
# SPDX-License-Identifier: MIT
4+
5+
name: check formatting
6+
7+
on:
8+
pull_request:
9+
10+
jobs:
11+
rustfmt:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: install Rust stable and rustfmt
18+
uses: dtolnay/rust-toolchain@stable
19+
with:
20+
components: rustfmt
21+
22+
- name: run cargo fmt
23+
run: cargo fmt --all -- --check
24+
25+
prettier:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
- name: Cache pnpm modules
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.pnpm-store
33+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
34+
restore-keys: |
35+
${{ runner.os }}-
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: 'lts/*'
39+
- uses: pnpm/action-setup@v4
40+
with:
41+
version: 9.x.x
42+
run_install: true
43+
- run: pnpm format:check
44+
45+
taplo:
46+
name: taplo (.toml files)
47+
runs-on: ubuntu-latest
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: install Rust stable
52+
uses: dtolnay/rust-toolchain@stable
53+
54+
- name: install taplo-cli
55+
uses: taiki-e/install-action@v2
56+
with:
57+
tool: taplo-cli
58+
59+
- run: taplo fmt --check --diff

.github/workflows/integration-tests.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ on:
1010
- v1
1111
- v2
1212
paths:
13-
- ".github/workflows/integration-tests.yml"
14-
- "plugins/updater/src/**"
13+
- '.github/workflows/integration-tests.yml'
14+
- 'plugins/updater/src/**'
1515
pull_request:
1616
branches:
1717
- v1
1818
- v2
1919
paths:
20-
- ".github/workflows/integration-tests.yml"
21-
- "plugins/updater/src/**"
20+
- '.github/workflows/integration-tests.yml'
21+
- 'plugins/updater/src/**'
2222

2323
jobs:
2424
run-integration-tests:

.github/workflows/lint-javascript.yml

+13-33
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ on:
1010
- v1
1111
- v2
1212
paths:
13-
- ".github/workflows/lint-javascript.yml"
14-
- "plugins/*/guest-js/**"
15-
- ".eslintignore"
16-
- ".eslintrc.json"
17-
- ".prettierignore"
18-
- "**/package.json"
13+
- '.github/workflows/lint-javascript.yml'
14+
- 'plugins/*/guest-js/**'
15+
- '.eslintignore'
16+
- '.eslintrc.json'
17+
- '.prettierignore'
18+
- '**/package.json'
1919
pull_request:
2020
branches:
2121
- v1
2222
- v2
2323
paths:
24-
- ".github/workflows/lint-javascript.yml"
25-
- "plugins/*/guest-js/**"
26-
- ".eslintignore"
27-
- ".eslintrc.json"
28-
- ".prettierignore"
29-
- "**/package.json"
24+
- '.github/workflows/lint-javascript.yml'
25+
- 'plugins/*/guest-js/**'
26+
- '.eslintignore'
27+
- '.eslintrc.json'
28+
- '.prettierignore'
29+
- '**/package.json'
3030

3131
concurrency:
3232
group: ${{ github.workflow }}-${{ github.ref }}
@@ -46,30 +46,10 @@ jobs:
4646
${{ runner.os }}-
4747
- uses: actions/setup-node@v4
4848
with:
49-
node-version: "lts/*"
49+
node-version: 'lts/*'
5050
- uses: pnpm/action-setup@v4
5151
with:
5252
version: 9.x.x
5353
run_install: true
5454
- name: eslint
5555
run: pnpm lint
56-
prettier:
57-
runs-on: ubuntu-latest
58-
steps:
59-
- uses: actions/checkout@v4
60-
- name: Cache pnpm modules
61-
uses: actions/cache@v4
62-
with:
63-
path: ~/.pnpm-store
64-
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
65-
restore-keys: |
66-
${{ runner.os }}-
67-
- uses: actions/setup-node@v4
68-
with:
69-
node-version: "lts/*"
70-
- uses: pnpm/action-setup@v4
71-
with:
72-
version: 9.x.x
73-
run_install: true
74-
- name: prettier check
75-
run: pnpm format-check

.github/workflows/lint-rust.yml

+8-26
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ on:
1010
- v1
1111
- v2
1212
paths:
13-
- ".github/workflows/lint-rust.yml"
14-
- "plugins/*/src/**"
15-
- "!plugins/*/src/api-iife.js"
16-
- "**/Cargo.toml"
13+
- '.github/workflows/lint-rust.yml'
14+
- 'plugins/*/src/**'
15+
- '!plugins/*/src/api-iife.js'
16+
- '**/Cargo.toml'
1717
pull_request:
1818
branches:
1919
- v1
2020
- v2
2121
paths:
22-
- ".github/workflows/lint-rust.yml"
23-
- "plugins/*/src/**"
24-
- "!plugins/*/src/api-iife.js"
25-
- "**/Cargo.toml"
22+
- '.github/workflows/lint-rust.yml'
23+
- 'plugins/*/src/**'
24+
- '!plugins/*/src/api-iife.js'
25+
- '**/Cargo.toml'
2626

2727
concurrency:
2828
group: ${{ github.workflow }}-${{ github.ref }}
@@ -147,10 +147,6 @@ jobs:
147147

148148
- uses: Swatinem/rust-cache@v2
149149

150-
- name: create dummy dist
151-
working-directory: examples/api
152-
run: mkdir dist
153-
154150
- name: clippy ${{ matrix.package }}
155151
if: matrix.package != 'tauri-plugin-sql'
156152
run: cargo clippy --package ${{ matrix.package }} --all-targets -- -D warnings
@@ -162,17 +158,3 @@ jobs:
162158
- name: clippy ${{ matrix.package }} postgres
163159
if: matrix.package == 'tauri-plugin-sql'
164160
run: cargo clippy --package ${{ matrix.package }} --all-targets --no-default-features --features postgres -- -D warnings
165-
166-
fmt:
167-
runs-on: ubuntu-latest
168-
169-
steps:
170-
- uses: actions/checkout@v4
171-
172-
- name: Install rustfmt with nightly toolchain
173-
uses: dtolnay/rust-toolchain@nightly
174-
with:
175-
components: rustfmt
176-
177-
- name: Check formatting
178-
run: cargo fmt --all -- --check

.github/workflows/sync.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
3535
- uses: actions/setup-node@v4
3636
with:
37-
node-version: "lts/*"
37+
node-version: 'lts/*'
3838

3939
- uses: pnpm/action-setup@v4
4040
with:

0 commit comments

Comments
 (0)