Skip to content

Commit 1934ae5

Browse files
chore: add dprint (#326)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 8d6da48 commit 1934ae5

25 files changed

+822
-784
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -105,7 +105,7 @@ Violating these terms may lead to a permanent ban.
105105
### 4. Permanent Ban
106106

107107
**Community Impact**: Demonstrating a pattern of violation of community
108-
standards, including sustained inappropriate behavior, harassment of an
108+
standards, including sustained inappropriate behavior, harassment of an
109109
individual, or aggression toward or disparagement of classes of individuals.
110110

111111
**Consequence**: A permanent ban from any sort of public interaction within
@@ -117,8 +117,7 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117117
version 2.0, available at
118118
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119119

120-
Community Impact Guidelines were inspired by [Mozilla's code of conduct
121-
enforcement ladder](https://github.com/mozilla/diversity).
120+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
122121

123122
[homepage]: https://www.contributor-covenant.org
124123

.github/workflows/autofix.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,26 @@ jobs:
1717
- uses: Boshen/setup-rust@main
1818
with:
1919
restore-cache: false
20-
tools: just,cargo-shear@1,taplo-cli
20+
tools: just,cargo-shear@1,dprint
2121
components: rustfmt
2222

23+
- name: Restore dprint plugin cache
24+
id: cache-restore
25+
uses: actions/cache/restore@v4
26+
with:
27+
key: dprint-autofix-ci-${{ runner.os }}-${{ hashFiles('dprint.json') }}
28+
path: ~/.cache/dprint
29+
2330
- run: just fmt
2431

2532
- uses: autofix-ci/action@v1.3.1
2633
with:
2734
fail-fast: false
35+
36+
- name: Save dprint plugin cache
37+
if: ${{ github.ref_name == 'main' }}
38+
id: cache-save
39+
uses: actions/cache/save@v4
40+
with:
41+
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
42+
path: ~/.cache/dprint

.github/workflows/benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
pull_request:
66
types: [opened, synchronize]
77
paths-ignore:
8-
- '**/*.md'
8+
- "**/*.md"
99
push:
1010
branches:
1111
- main
1212
paths-ignore:
13-
- '**/*.md'
13+
- "**/*.md"
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ on:
55
pull_request:
66
types: [opened, synchronize]
77
paths-ignore:
8-
- '**/*.md'
9-
- '!.github/workflows/ci.yml'
8+
- "**/*.md"
9+
- "!.github/workflows/ci.yml"
1010
push:
1111
branches:
1212
- main
1313
- "renovate/**"
1414
paths-ignore:
15-
- '**/*.md'
16-
- '!.github/workflows/ci.yml'
15+
- "**/*.md"
16+
- "!.github/workflows/ci.yml"
1717

1818
concurrency:
1919
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}

.github/workflows/codecov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
pull_request:
66
types: [opened, synchronize]
77
paths-ignore:
8-
- '**/*.md'
8+
- "**/*.md"
99
push:
1010
branches:
1111
- main
1212
paths-ignore:
13-
- '**/*.md'
13+
- "**/*.md"
1414

1515
concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}

.github/workflows/release-napi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- npm/package.json # Please only commit this file, so we don't need to wait for test CI to pass.
1010

1111
env:
12-
DEBUG: 'napi:*'
12+
DEBUG: "napi:*"
1313

1414
concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}
@@ -175,10 +175,10 @@ jobs:
175175
RUSTUP_IO_THREADS: 1
176176
with:
177177
operating_system: freebsd
178-
version: '14.0'
178+
version: "14.0"
179179
memory: 8G
180180
cpu_count: 3
181-
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
181+
environment_variables: "DEBUG RUSTUP_IO_THREADS"
182182
shell: bash
183183
run: |
184184
sudo pkg install -y -f curl node libnghttp2 npm

.taplo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ include = ["Cargo.toml", "napi/Cargo.toml"]
22

33
[formatting]
44
align_entries = true
5-
column_width = 120
5+
column_width = 120

Cargo.toml

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,89 @@
11
[workspace]
2-
members = ["napi"]
2+
members = ["napi"]
33
resolver = "2"
44

55
[package]
6-
version = "2.1.1"
7-
name = "oxc_resolver"
8-
authors = ["Boshen <boshenc@gmail.com>"]
9-
categories = ["development-tools"]
10-
description = "ESM / CJS module resolution"
11-
edition = "2021"
12-
homepage = "https://github.com/oxc-project/oxc-resolver"
13-
keywords = ["node", "resolve", "cjs", "esm", "enhanced-resolve"]
14-
license = "MIT"
15-
readme = "README.md"
16-
repository = "https://github.com/oxc-project/oxc-resolver"
6+
name = "oxc_resolver"
7+
version = "2.1.1"
8+
authors = ["Boshen <boshenc@gmail.com>"]
9+
categories = ["development-tools"]
10+
edition = "2021"
11+
homepage = "https://github.com/oxc-project/oxc-resolver"
12+
include = ["/src", "/examples", "/benches"]
13+
keywords = ["node", "resolve", "cjs", "esm", "enhanced-resolve"]
14+
license = "MIT"
15+
readme = "README.md"
16+
repository = "https://github.com/oxc-project/oxc-resolver"
1717
rust-version = "1.74"
18-
include = ["/src", "/examples", "/benches"]
18+
description = "ESM / CJS module resolution"
1919

2020
[lib]
2121
doctest = false
2222

2323
[[bench]]
24-
name = "resolver"
24+
name = "resolver"
2525
harness = false
2626

2727
[lints.clippy]
28-
all = { level = "warn", priority = -1 }
28+
all = { level = "warn", priority = -1 }
2929
cargo = { level = "warn", priority = -1 }
3030
# restriction
31-
dbg_macro = "warn"
32-
todo = "warn"
31+
dbg_macro = "warn"
32+
todo = "warn"
3333
unimplemented = "warn"
3434
# I like the explicitness of this rule as it removes confusion around `clone`.
3535
# This increases readability, avoids `clone` mindlessly and heap allocating on accident.
3636
clone_on_ref_ptr = "warn"
3737
# These two are mutually exclusive, I like `mod.rs` files for better fuzzy searches on module entries.
38-
self_named_module_files = "warn" # "-Wclippy::mod_module_files"
39-
empty_drop = "warn"
40-
empty_structs_with_brackets = "warn"
41-
exit = "warn"
42-
filetype_is_file = "warn"
43-
get_unwrap = "warn"
44-
impl_trait_in_params = "warn"
45-
rc_buffer = "warn"
46-
rc_mutex = "warn"
38+
self_named_module_files = "warn" # "-Wclippy::mod_module_files"
39+
empty_drop = "warn"
40+
empty_structs_with_brackets = "warn"
41+
exit = "warn"
42+
filetype_is_file = "warn"
43+
get_unwrap = "warn"
44+
impl_trait_in_params = "warn"
45+
rc_buffer = "warn"
46+
rc_mutex = "warn"
4747
rest_pat_in_fully_bound_structs = "warn"
48-
unnecessary_safety_comment = "warn"
49-
undocumented_unsafe_blocks = "warn"
48+
unnecessary_safety_comment = "warn"
49+
undocumented_unsafe_blocks = "warn"
5050
# I want to write the best Rust code so both pedantic and nursery is enabled.
5151
# We should only disable rules globally if they are either false positives, chaotic, or does not make sense.
52-
nursery = { level = "warn", priority = -1 }
52+
nursery = { level = "warn", priority = -1 }
5353
pedantic = { level = "warn", priority = -1 }
5454
# Allowed rules
5555
# pedantic
5656
# This rule is too pedantic, I don't want to force this because naming things are hard.
5757
module_name_repetitions = "allow"
58-
doc_markdown = "allow"
58+
doc_markdown = "allow"
5959
# cargo
6060
multiple_crate_versions = "allow"
6161

6262
[[example]]
6363
name = "resolver"
6464

6565
[dependencies]
66-
tracing = "0.1"
66+
cfg-if = "1"
6767
dashmap = "6"
68-
serde = { version = "1", features = ["derive"] } # derive for Deserialize from package.json
69-
serde_json = { version = "1", features = [
70-
"preserve_order",
71-
] } # preserve_order: package_json.exports requires order such as `["require", "import", "default"]`
72-
rustc-hash = { version = "2" }
73-
once_cell = "1" # Use `std::sync::OnceLock::get_or_try_init` when it is stable.
74-
thiserror = "1"
75-
json-strip-comments = "1"
7668
indexmap = { version = "2", features = ["serde"] }
77-
cfg-if = "1"
69+
json-strip-comments = "1"
70+
once_cell = "1" # Use `std::sync::OnceLock::get_or_try_init` when it is stable.
71+
rustc-hash = { version = "2" }
72+
serde = { version = "1", features = ["derive"] } # derive for Deserialize from package.json
73+
serde_json = { version = "1", features = ["preserve_order"] } # preserve_order: package_json.exports requires order such as `["require", "import", "default"]`
7874
simdutf8 = { version = "0.1" }
75+
thiserror = "1"
76+
tracing = "0.1"
7977

8078
pnp = { version = "0.9.0", optional = true }
8179

8280
document-features = { version = "0.2.10", optional = true }
8381

8482
[dev-dependencies]
85-
vfs = "0.12.0" # for testing with in memory file system
86-
rayon = { version = "1.10.0" }
87-
criterion2 = { version = "2.0.0", default-features = false }
83+
criterion2 = { version = "2.0.0", default-features = false }
8884
normalize-path = { version = "0.2.1" }
85+
rayon = { version = "1.10.0" }
86+
vfs = "0.12.0" # for testing with in memory file system
8987

9088
[features]
9189
default = []
@@ -105,9 +103,9 @@ rustdoc-args = ["--cfg", "docsrs"]
105103
[profile.release]
106104
# Configurations explicitly listed here for clarity.
107105
# Using the best options for performance.
108-
opt-level = 3
109-
lto = "fat"
106+
opt-level = 3
107+
lto = "fat"
110108
codegen-units = 1
111-
strip = "symbols" # set to `false` for debug information
112-
debug = false # set to `true` for debug information
113-
panic = "abort" # Let it crash and force ourselves to write safe Rust.
109+
strip = "symbols" # set to `false` for debug information
110+
debug = false # set to `true` for debug information
111+
panic = "abort" # Let it crash and force ourselves to write safe Rust.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy