diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e6f0a2..fca89dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,28 @@ name: Continuous integration on: [push, pull_request] +env: + RUSTFLAGS: "-Dwarnings" + RUSTDOCFLAGS: "-Dwarnings" + jobs: - ci: + test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.81.0 - run: cargo build - run: cargo test + + checks: + name: Check clippy, formatting, and documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@1.81.0 + with: + components: clippy, rustfmt + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy --workspace --all-targets --all-features + - run: cargo fmt --check --all + - run: cargo doc --workspace --no-deps diff --git a/src/chunk.rs b/src/chunk.rs index 7649b86..6224431 100644 --- a/src/chunk.rs +++ b/src/chunk.rs @@ -293,11 +293,11 @@ pub(crate) fn split_token_lists(vals: ChunksRef, keyword: &str) -> Vec { /// /// For Normal Chunks, /// - The leading/trailing keyword is not considered as a valid split -/// (regardless of whether the keyword is preceded/followed by some -/// whitespace). +/// (regardless of whether the keyword is preceded/followed by some +/// whitespace). /// - If there are consecutive keywords, the characters between two consecutive -/// keywords (whether only whitespace or not) will be considered as a valid -/// split. +/// keywords (whether only whitespace or not) will be considered as a valid +/// split. pub(crate) fn split_token_lists_with_kw(vals: ChunksRef, keyword: &str) -> Vec { let mut out = vec![]; let mut latest = vec![]; diff --git a/src/types/person.rs b/src/types/person.rs index fa7500c..d2388bb 100644 --- a/src/types/person.rs +++ b/src/types/person.rs @@ -57,7 +57,7 @@ impl Person { let prefix = person.remove("prefix").unwrap_or_default(); let suffix = person.remove("suffix").unwrap_or_default(); - return Self { name, given_name, prefix, suffix }; + Self { name, given_name, prefix, suffix } } fn parse_bibtex(chunks: ChunksRef) -> Self {