Skip to content

Commit

Permalink
chore(cawg_identity): Use stricter formatting rules for CAWG identity…
Browse files Browse the repository at this point in the history
… SDK (#826)
  • Loading branch information
scouten-adobe authored Jan 8, 2025
1 parent 9d923cf commit 553d53d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ jobs:
echo Will add nightly suffix $NIGHTLY_SUFFIX
sed -i "s/^version = \"\\(.*\\)\"/version = \"\\1$NIGHTLY_SUFFIX\"/" sdk/Cargo.toml
sed -i "s/path = \"..\/sdk\", version = \"\\(.*\\)\"/path = \"..\/sdk\", version = \"\\1$NIGHTLY_SUFFIX\"/" cawg_identity/Cargo.toml
sed -i "s/path = \"..\/sdk\", version = \"\\(.*\\)\"/path = \"..\/sdk\", version = \"\\1$NIGHTLY_SUFFIX\"/" cli/Cargo.toml
cargo update -w
Expand Down
17 changes: 17 additions & 0 deletions cawg_identity/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# IMPORTANT: PR validation uses nightly version of
# rustfmt.

# Invoke by using:
#
# rustup toolchain add nightly
# cargo +nightly fmt

blank_lines_upper_bound = 1
empty_item_single_line = true
format_code_in_doc_comments = true
group_imports = "StdExternalCrate"
hex_literal_case = "Lower"
imports_granularity = "Crate"
reorder_impl_items = true
unstable_features = true
wrap_comments = true
9 changes: 7 additions & 2 deletions cawg_identity/src/identity_assertion/signer_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ use serde::{Deserialize, Serialize};

use crate::internal::debug_byte_slice::DebugByteSlice;

/// A set of _referenced assertions_ and other related data, known overall as the **signer payload.** This binding **SHOULD** generally be construed as authorization of or participation in the creation of the statements described by those assertions and corresponding portions of the C2PA asset in which they appear.
/// A set of _referenced assertions_ and other related data, known overall as
/// the **signer payload.** This binding **SHOULD** generally be construed as
/// authorization of or participation in the creation of the statements
/// described by those assertions and corresponding portions of the C2PA asset
/// in which they appear.
///
/// This is described in [§5.1, Overview], of the CAWG Identity Assertion specification.
/// This is described in [§5.1, Overview], of the CAWG Identity Assertion
/// specification.
///
/// [§5.1, Overview]: https://cawg.io/identity/1.1-draft/#_overview
#[derive(Clone, Debug, Deserialize, Eq, Serialize, PartialEq)]
Expand Down
6 changes: 4 additions & 2 deletions cawg_identity/src/tests/fixtures/async_test_signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use c2pa_crypto::raw_signature::{
async_signer_from_cert_chain_and_private_key, AsyncRawSigner, SigningAlg,
};

/// Creates an [`AsyncSigner`] instance for testing purposes using test credentials.
/// Creates an [`AsyncSigner`] instance for testing purposes using test
/// credentials.
///
/// [`AsyncSigner`]: c2pa::AsyncSigner
#[cfg(not(target_arch = "wasm32"))]
Expand All @@ -33,7 +34,8 @@ pub(crate) fn async_test_signer(alg: SigningAlg) -> Box<dyn AsyncSigner + Sync +
))
}

/// Creates an [`AsyncSigner`] instance for testing purposes using test credentials.
/// Creates an [`AsyncSigner`] instance for testing purposes using test
/// credentials.
///
/// [`AsyncSigner`]: c2pa::AsyncSigner
#[cfg(target_arch = "wasm32")]
Expand Down

0 comments on commit 553d53d

Please sign in to comment.