Skip to content

Commit

Permalink
feat: Format toml files (#630)
Browse files Browse the repository at this point in the history
* feat: Format toml files

* feat: Add `dprint.json`

* feat: Add `dprint` check CI job

* refactor: Use `toml` defaults

* refactor: Remove framework docs from excluded dirs

* feat: Add documentation on `dprint`
  • Loading branch information
PhilippGackstatter authored Jun 13, 2024
1 parent a07210c commit 28bb940
Show file tree
Hide file tree
Showing 228 changed files with 1,529 additions and 1,568 deletions.
33 changes: 19 additions & 14 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@
# configuration file. This is a similar workaround to the ones presented here:
# <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
xclippy = [
"clippy", "--all-targets", "--all-features", "--",
"-Wclippy::all",
"-Wclippy::disallowed_methods",
"clippy",
"--all-targets",
"--all-features",
"--",
"-Wclippy::all",
"-Wclippy::disallowed_methods",
]
xtest = "run --package x --bin x -- external-crates-tests"

# Configuration specifically for running clippy on `external-crates/move/`.
# Some of these allows are to avoid code churn; others are filed as issues on the `sui` repo now.
move-clippy = [
"clippy", "--",
"-Wclippy::all",
"-Wclippy::disallowed_methods",
"-Aclippy::upper_case_acronyms",
"-Aclippy::type_complexity",
# Remove after https://github.com/rust-lang/rust-clippy/pull/11792 is released.
"-Aclippy::map_identity",
"-Aclippy::new_without_default",
"-Aclippy::box_default",
"-Aclippy::manual_slice_size_calculation",
"clippy",
"--",
"-Wclippy::all",
"-Wclippy::disallowed_methods",
"-Aclippy::upper_case_acronyms",
"-Aclippy::type_complexity",
# Remove after https://github.com/rust-lang/rust-clippy/pull/11792 is released.
"-Aclippy::map_identity",
"-Aclippy::new_without_default",
"-Aclippy::box_default",
"-Aclippy::manual_slice_size_calculation",
]

ci-license = "license-template --template .license_template"
Expand All @@ -33,5 +37,6 @@ rustflags = ["-C", "force-frame-pointers=yes", "-C", "force-unwind-tables=yes"]
# 64 bit MSVC, override default 1M stack with 8M stack
[target.x86_64-pc-windows-msvc]
rustflags = [
"-C", "link-arg=/STACK:8000000"
"-C",
"link-arg=/STACK:8000000",
]
26 changes: 13 additions & 13 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
too-many-arguments-threshold = 20
disallowed-methods = [
# we use tracing with the log feature instead of the log crate.
{ path = "log::info", reason = "use tracing::info instead" },
{ path = "log::debug", reason = "use tracing::debug instead" },
{ path = "log::error", reason = "use tracing::error instead" },
{ path = "log::warn", reason = "use tracing::warn instead" },
# unbounded channels are for expert use only
{ path = "tokio::sync::mpsc::unbounded_channel", reason = "use a bounded channel instead" },
{ path = "futures::channel::mpsc::unbounded", reason = "use a bounded channel instead" },
{ path = "futures_channel::mpsc::unbounded", reason = "use a bounded channel instead" },
# known to cause blocking issues
{ path = "futures::executor::block_on", reason = "use tokio::runtime::runtime::Runtime::block_on instead"},
# bincode::deserialize_from is easy to shoot your foot with
{ path = "bincode::deserialize_from", reason = "use bincode::deserialize instead" },
# we use tracing with the log feature instead of the log crate.
{ path = "log::info", reason = "use tracing::info instead" },
{ path = "log::debug", reason = "use tracing::debug instead" },
{ path = "log::error", reason = "use tracing::error instead" },
{ path = "log::warn", reason = "use tracing::warn instead" },
# unbounded channels are for expert use only
{ path = "tokio::sync::mpsc::unbounded_channel", reason = "use a bounded channel instead" },
{ path = "futures::channel::mpsc::unbounded", reason = "use a bounded channel instead" },
{ path = "futures_channel::mpsc::unbounded", reason = "use a bounded channel instead" },
# known to cause blocking issues
{ path = "futures::executor::block_on", reason = "use tokio::runtime::runtime::Runtime::block_on instead" },
# bincode::deserialize_from is easy to shoot your foot with
{ path = "bincode::deserialize_from", reason = "use bincode::deserialize instead" },
]
8 changes: 8 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ jobs:
- name: Check Rust formatting
run: cargo +nightly fmt --check

dprint-format:
runs-on: [ubuntu-latest]
steps:
- name: Install dprint
run: npm install -g dprint
- name: Check dprint formatting
run: dprint check

cargo-deny:
name: cargo-deny (advisories, licenses, bans, ...)
needs: diff
Expand Down
2 changes: 1 addition & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[default]
extend-ignore-re = [
"[a-zA-Z0-9]{44}"
"[a-zA-Z0-9]{44}",
]

[default.extend-words]
Expand Down
Loading

0 comments on commit 28bb940

Please sign in to comment.