Skip to content

Commit

Permalink
Add toml formatting (#393)
Browse files Browse the repository at this point in the history
* Add dprint for Cargo.toml formatting

Add dprint check to format CI action.

* Format toml files

* Fix format workflow

* Use pre-packaged dprint from npm

* Disable incremental compilation in CI

Attempt to reduce cache size.

* Fix rustdoc lint warnings

Re-enable incremental cargo compilation in CI except for build-and-test-wasm.

* Remove redundant format check
  • Loading branch information
cycraig committed Sep 13, 2021
1 parent 3c59fab commit d768f7f
Show file tree
Hide file tree
Showing 26 changed files with 121 additions and 101 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ jobs:
sccache-path: /home/runner/.cache/sccache
env:
SCCACHE_DIR: ${{ matrix.sccache-path }}
CARGO_INCREMENTAL: 0 # disabled to reduce target cache size
RUSTC_WRAPPER: sccache

steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,21 @@ jobs:
toolchain: stable
override: true
components: clippy

- name: core clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features -- -D warnings
name: core

- name: wasm clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./bindings/wasm/Cargo.toml --all-targets --all-features -- -D warnings
name: wasm

- name: libjose clippy check
uses: actions-rs/clippy-check@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-07-05
toolchain: nightly-2021-09-07
override: true
components: llvm-tools-preview
- uses: actions-rs/install@v0.1
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,34 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-07-05
toolchain: nightly-2021-09-07
override: true
components: rustfmt

- name: Install dprint
run: npm install -g dprint
#run: cargo install dprint # installing from source is slow, ~5 minutes

- name: core fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: wasm fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./bindings/wasm/Cargo.toml --all -- --check

- name: libjose fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./libjose/Cargo.toml --all -- --check

# Use `dprint` to check Cargo.toml formatting.
# To fix, run `dprint fmt` locally.
- name: Cargo.toml fmt check
run:
dprint check
2 changes: 1 addition & 1 deletion .github/workflows/scripts/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
rm -rf coverage
mkdir coverage

NIGHTLY="+nightly-2021-07-05"
NIGHTLY="+nightly-2021-09-07"

# Run tests with profiling instrumentation
echo "Running instrumented unit tests..."
Expand Down
8 changes: 4 additions & 4 deletions bindings/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name = "identity-wasm"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "Web Assembly bindings for the identity-rs crate."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity", "wasm"]
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity", "wasm"]
homepage = "https://www.iota.org"
resolver = "2"
description = "Web Assembly bindings for the identity-rs crate."

[lib]
crate-type = ["cdylib", "rlib"]
Expand Down
11 changes: 11 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://dprint.dev/schemas/v0.json",
"incremental": true,
"toml": {
},
"includes": ["**/*.toml"],
"excludes": [],
"plugins": [
"https://plugins.dprint.dev/toml-0.5.1.wasm"
]
}
28 changes: 10 additions & 18 deletions identity-account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "identity-account"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "Secure storage for Decentralized Identifiers and Verifiable Credentials."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity"]
license = "Apache-2.0"
readme = "../README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity"]
homepage = "https://www.iota.org"
description = "Secure storage for Decentralized Identifiers and Verifiable Credentials."

[dependencies]
actix = { version = "0.12.0", optional = true }
Expand All @@ -23,10 +23,7 @@ itoa = { version = "0.4" }
log = { version = "0.4", default-features = false }
once_cell = { version = "1.7", default-features = false, features = ["std"] }
paste = { version = "1.0" }
serde = { version = "1.0", default-features = false, features = [
"alloc",
"derive",
] }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
slog = { version = "2.7" }
strum = { version = "0.21", features = ["derive"] }
thiserror = { version = "1.0" }
Expand All @@ -50,20 +47,15 @@ optional = true
[dev-dependencies]
rand = { version = "0.8" }
rusty-fork = { version = "0.3" }
tokio = { version = "1.5", features = [
"macros",
"rt",
"rt-multi-thread",
"sync",
] }
tokio = { version = "1.5", features = ["macros", "rt", "rt-multi-thread", "sync"] }

[features]
mem-client = []
stronghold = [
"iota_stronghold",
"stronghold_engine",
"actix",
"tokio/rt-multi-thread",
"iota_stronghold",
"stronghold_engine",
"actix",
"tokio/rt-multi-thread",
]
wasm = ["identity-iota/wasm"]
async = ["identity-iota/async"]
Expand Down
8 changes: 4 additions & 4 deletions identity-account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
rust_2018_idioms,
unreachable_pub,
// missing_docs,
// missing_crate_level_docs,
broken_intra_doc_links,
private_intra_doc_links,
private_doc_tests,
// rustdoc::missing_crate_level_docs,
rustdoc::broken_intra_doc_links,
rustdoc::private_intra_doc_links,
rustdoc::private_doc_tests,
clippy::missing_safety_doc,
// clippy::missing_errors_doc
)]
Expand Down
8 changes: 4 additions & 4 deletions identity-comm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "identity-comm"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "An implementation of the DIDComm Messaging Specification."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity"]
license = "Apache-2.0"
readme = "../README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity"]
homepage = "https://www.iota.org"
description = "An implementation of the DIDComm Messaging Specification."

[dependencies]
identity-core = { path = "../identity-core", version = "=0.3.0" }
Expand Down
8 changes: 4 additions & 4 deletions identity-comm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
rust_2018_idioms,
// unreachable_pub,
// missing_docs,
missing_crate_level_docs,
broken_intra_doc_links,
private_intra_doc_links,
private_doc_tests,
rustdoc::missing_crate_level_docs,
rustdoc::broken_intra_doc_links,
rustdoc::private_intra_doc_links,
rustdoc::private_doc_tests,
clippy::missing_safety_doc,
// clippy::missing_errors_doc,
)]
Expand Down
14 changes: 7 additions & 7 deletions identity-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ name = "identity-core"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "The core traits and types for the identity-rs library."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity"]
license = "Apache-2.0"
readme = "../README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity"]
homepage = "https://www.iota.org"
description = "The core traits and types for the identity-rs library."

[dependencies]
base64 = { version = "0.13", default-features = false, features = ["std"] }
bs58 = { version = "0.4", default-features = false, features = ["std"] }
multibase = { version = "0.9", default-features = false, features = ["std"] }
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
hex = { version = "0.4", default-features = false }
identity-diff = { version = "=0.3.0", path = "../identity-diff", default-features = false }
multibase = { version = "0.9", default-features = false, features = ["std"] }
roaring = { version = "0.7", default-features = false }
serde = { version = "1.0", default-features = false, features = ["std", "derive"] }
serde_jcs = { version = "0.1", default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
subtle = { version = "2.4", default-features = false }
strum = { version = "0.21", features = ["derive"] }
subtle = { version = "2.4", default-features = false }
thiserror = { version = "1.0", default-features = false }
typenum = { version = "1.13", default-features = false }
url = { version = "2.2", default-features = false, features = ["serde"] }
Expand All @@ -34,9 +34,9 @@ default-features = false
features = ["blake2b", "ed25519", "random", "sha"]

[dev-dependencies]
rand = { version = "0.8" }
quickcheck = { version = "1.0" }
quickcheck_macros = { version = "1.0" }
rand = { version = "0.8" }

[package.metadata.docs.rs]
# To build locally:
Expand Down
8 changes: 4 additions & 4 deletions identity-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
rust_2018_idioms,
unreachable_pub,
missing_docs,
missing_crate_level_docs,
broken_intra_doc_links,
private_intra_doc_links,
private_doc_tests,
rustdoc::missing_crate_level_docs,
rustdoc::broken_intra_doc_links,
rustdoc::private_intra_doc_links,
rustdoc::private_doc_tests,
clippy::missing_safety_doc,
// clippy::missing_errors_doc
)]
Expand Down
8 changes: 4 additions & 4 deletions identity-credential/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "identity-credential"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "An implementation of the Verfiable Credentials standard."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity"]
license = "Apache-2.0"
readme = "../README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity"]
homepage = "https://www.iota.org"
description = "An implementation of the Verfiable Credentials standard."

[dependencies]
identity-core = { version = "=0.3.0", path = "../identity-core" }
Expand Down
8 changes: 4 additions & 4 deletions identity-credential/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
rust_2018_idioms,
unreachable_pub,
missing_docs,
missing_crate_level_docs,
broken_intra_doc_links,
private_intra_doc_links,
private_doc_tests,
rustdoc::missing_crate_level_docs,
rustdoc::broken_intra_doc_links,
rustdoc::private_intra_doc_links,
rustdoc::private_doc_tests,
clippy::missing_safety_doc,
// clippy::missing_errors_doc
)]
Expand Down
8 changes: 4 additions & 4 deletions identity-did/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "identity-did"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "An implementation of the Decentralized Identifiers standard."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity"]
license = "Apache-2.0"
readme = "../README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity"]
homepage = "https://www.iota.org"
description = "An implementation of the Decentralized Identifiers standard."

[dependencies]
async-trait = { version = "0.1", default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions identity-did/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
rust_2018_idioms,
unreachable_pub,
// missing_docs,
missing_crate_level_docs,
broken_intra_doc_links,
private_intra_doc_links,
private_doc_tests,
rustdoc::missing_crate_level_docs,
rustdoc::broken_intra_doc_links,
rustdoc::private_intra_doc_links,
rustdoc::private_doc_tests,
clippy::missing_safety_doc,
// clippy::missing_errors_doc
)]
Expand Down
8 changes: 4 additions & 4 deletions identity-diff/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "identity-diff"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "The `Diff` trait for the identity-rs library."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity"]
license = "Apache-2.0"
readme = "../README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity"]
homepage = "https://www.iota.org"
description = "The `Diff` trait for the identity-rs library."

[dependencies]
did_url = { version = "0.1", default-features = false, features = ["alloc"] }
Expand Down
8 changes: 4 additions & 4 deletions identity-diff/derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name = "identity-derive"
version = "0.3.0"
authors = ["IOTA Stiftung"]
edition = "2018"
description = "Derive `Diff` support for the identity-rs library."
homepage = "https://www.iota.org"
keywords = ["iota", "tangle", "identity"]
license = "Apache-2.0"
readme = "../../README.md"
repository = "https://github.com/iotaledger/identity.rs"
license = "Apache-2.0"
keywords = ["iota", "tangle", "identity"]
homepage = "https://www.iota.org"
description = "Derive `Diff` support for the identity-rs library."

[lib]
name = "identity_derive"
Expand Down
8 changes: 4 additions & 4 deletions identity-diff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
rust_2018_idioms,
unreachable_pub,
// missing_docs,
missing_crate_level_docs,
broken_intra_doc_links,
private_intra_doc_links,
private_doc_tests,
rustdoc::missing_crate_level_docs,
rustdoc::broken_intra_doc_links,
rustdoc::private_intra_doc_links,
rustdoc::private_doc_tests,
clippy::missing_safety_doc,
// clippy::missing_errors_doc,
)]
Expand Down

0 comments on commit d768f7f

Please sign in to comment.