diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3f3532d141..ab62858b38 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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: diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index bf19c24e14..470f8f30ce 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -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: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ef27bcf626..b836bd0502 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 9e491a7086..e2c3581d99 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -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 diff --git a/.github/workflows/scripts/coverage.sh b/.github/workflows/scripts/coverage.sh index 41675dd57c..798c83d1df 100755 --- a/.github/workflows/scripts/coverage.sh +++ b/.github/workflows/scripts/coverage.sh @@ -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..." diff --git a/bindings/wasm/Cargo.toml b/bindings/wasm/Cargo.toml index bc20870510..b6ed9c2d83 100644 --- a/bindings/wasm/Cargo.toml +++ b/bindings/wasm/Cargo.toml @@ -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"] diff --git a/dprint.json b/dprint.json new file mode 100644 index 0000000000..829af810cc --- /dev/null +++ b/dprint.json @@ -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" + ] +} diff --git a/identity-account/Cargo.toml b/identity-account/Cargo.toml index 768c706cb5..d94600b2eb 100644 --- a/identity-account/Cargo.toml +++ b/identity-account/Cargo.toml @@ -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 } @@ -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" } @@ -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"] diff --git a/identity-account/src/lib.rs b/identity-account/src/lib.rs index 200829ca78..0b2cf51b1a 100644 --- a/identity-account/src/lib.rs +++ b/identity-account/src/lib.rs @@ -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 )] diff --git a/identity-comm/Cargo.toml b/identity-comm/Cargo.toml index c3116a70f6..a61e4bfedb 100644 --- a/identity-comm/Cargo.toml +++ b/identity-comm/Cargo.toml @@ -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" } diff --git a/identity-comm/src/lib.rs b/identity-comm/src/lib.rs index 564085dde8..ab40abb583 100644 --- a/identity-comm/src/lib.rs +++ b/identity-comm/src/lib.rs @@ -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, )] diff --git a/identity-core/Cargo.toml b/identity-core/Cargo.toml index 4e081968cc..32efd57053 100644 --- a/identity-core/Cargo.toml +++ b/identity-core/Cargo.toml @@ -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"] } @@ -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: diff --git a/identity-core/src/lib.rs b/identity-core/src/lib.rs index 2d1c0e9c24..aa601d2616 100644 --- a/identity-core/src/lib.rs +++ b/identity-core/src/lib.rs @@ -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 )] diff --git a/identity-credential/Cargo.toml b/identity-credential/Cargo.toml index b81835dbca..5db742ff5d 100644 --- a/identity-credential/Cargo.toml +++ b/identity-credential/Cargo.toml @@ -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" } diff --git a/identity-credential/src/lib.rs b/identity-credential/src/lib.rs index 0c3e3deec6..340b67373d 100644 --- a/identity-credential/src/lib.rs +++ b/identity-credential/src/lib.rs @@ -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 )] diff --git a/identity-did/Cargo.toml b/identity-did/Cargo.toml index 686df20e3b..cae99cadaa 100644 --- a/identity-did/Cargo.toml +++ b/identity-did/Cargo.toml @@ -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 } diff --git a/identity-did/src/lib.rs b/identity-did/src/lib.rs index 084175325d..0b33ef6f18 100644 --- a/identity-did/src/lib.rs +++ b/identity-did/src/lib.rs @@ -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 )] diff --git a/identity-diff/Cargo.toml b/identity-diff/Cargo.toml index 54bb80051d..31674b1342 100644 --- a/identity-diff/Cargo.toml +++ b/identity-diff/Cargo.toml @@ -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"] } diff --git a/identity-diff/derive/Cargo.toml b/identity-diff/derive/Cargo.toml index a10eb32eca..9b45f0b3ec 100644 --- a/identity-diff/derive/Cargo.toml +++ b/identity-diff/derive/Cargo.toml @@ -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" diff --git a/identity-diff/src/lib.rs b/identity-diff/src/lib.rs index 2d5aa5c862..c1ffc622d3 100644 --- a/identity-diff/src/lib.rs +++ b/identity-diff/src/lib.rs @@ -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, )] diff --git a/identity-iota/Cargo.toml b/identity-iota/Cargo.toml index 2e4092ed68..d5f5a4a239 100644 --- a/identity-iota/Cargo.toml +++ b/identity-iota/Cargo.toml @@ -3,12 +3,12 @@ name = "identity-iota" version = "0.3.0" authors = ["IOTA Stiftung"] edition = "2018" -description = "An IOTA Tangle intergration 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 = "An IOTA Tangle intergration for the identity-rs library." [dependencies] async-trait = { version = "0.1", default-features = false } diff --git a/identity-iota/src/lib.rs b/identity-iota/src/lib.rs index 64281aeffc..5d146a0308 100644 --- a/identity-iota/src/lib.rs +++ b/identity-iota/src/lib.rs @@ -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, )] diff --git a/identity/Cargo.toml b/identity/Cargo.toml index 85b67005a2..4476d32e16 100644 --- a/identity/Cargo.toml +++ b/identity/Cargo.toml @@ -2,14 +2,14 @@ name = "identity" version = "0.3.0" authors = ["IOTA Stiftung"] +documentation = "https://identity.docs.iota.org" edition = "2018" -description = "Tools for working with Self-sovereign Identity." +homepage = "https://www.iota.org" +keywords = ["iota", "tangle", "identity", "did"] +license = "Apache-2.0" readme = "../README.md" repository = "https://github.com/iotaledger/identity.rs" -license = "Apache-2.0" -keywords = ["iota", "tangle", "identity", "did"] -homepage = "https://www.iota.org" -documentation = "https://identity.docs.iota.org" +description = "Tools for working with Self-sovereign Identity." [dependencies] identity-account = { version = "=0.3.0", path = "../identity-account", optional = true } diff --git a/identity/src/lib.rs b/identity/src/lib.rs index d230533626..9f6fc66f70 100644 --- a/identity/src/lib.rs +++ b/identity/src/lib.rs @@ -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 )] diff --git a/libjose/Cargo.toml b/libjose/Cargo.toml index b3ca331bc5..eeb99477b5 100644 --- a/libjose/Cargo.toml +++ b/libjose/Cargo.toml @@ -3,12 +3,12 @@ name = "libjose" version = "0.1.0" authors = ["IOTA Stiftung"] edition = "2018" -description = "A library for JOSE (JSON Object Signing and Encryption)" +homepage = "https://www.iota.org" +keywords = ["iota", "tangle", "identity", "jose", "jwa", "jwe", "jwk", "jwm", "jws", "jwt"] +license = "Apache-2.0" readme = "README.md" repository = "https://github.com/iotaledger/identity.rs" -license = "Apache-2.0" -keywords = ["iota", "tangle", "identity", "jose", "jwa", "jwe", "jwk", "jwm", "jws", "jwt"] -homepage = "https://www.iota.org" +description = "A library for JOSE (JSON Object Signing and Encryption)" [dependencies] base64 = { version = "0.13", default-features = false } diff --git a/libjose/src/lib.rs b/libjose/src/lib.rs index 6027670950..12872ce4ba 100644 --- a/libjose/src/lib.rs +++ b/libjose/src/lib.rs @@ -28,10 +28,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, )]