diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d068a6..3a1f76d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,39 +6,35 @@ jobs: check: name: Check runs-on: ubuntu-latest - strategy: - matrix: - toolchain: [stable, beta, nightly] steps: - name: Checkout sources - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - run: rustup update ${{ matrix.toolchain }} - - run: rustup default ${{ matrix.toolchain }} - - run: cargo check --all + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - run: rustup update stable + - run: rustup default stable + - run: cargo check --all-targets test: name: Test Suite runs-on: ubuntu-latest - strategy: - matrix: - toolchain: [stable, beta, nightly] steps: - name: Checkout sources - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - run: rustup update ${{ matrix.toolchain }} - - run: rustup default ${{ matrix.toolchain }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - run: rustup update stable + - run: rustup default stable - run: cargo test --all lints: name: Lints runs-on: ubuntu-latest - strategy: - matrix: - toolchain: [stable] steps: - name: Checkout sources - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - run: rustup update ${{ matrix.toolchain }} - - run: rustup default ${{ matrix.toolchain }} + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - run: rustup update stable + - run: rustup default stable + - run: rustup component add rustfmt clippy - run: cargo fmt --all -- --check - - run: cargo clippy --all -- -D warnings + - run: cargo clippy --all-targets -- -D warnings + - name: Doc + env: + RUSTDOCFLAGS: -D warnings + run: cargo doc --no-deps diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 93dbb7d..4cf9391 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,19 +1,15 @@ name: GitHub Pages Deploy -# Controls when the workflow will run on: push: - branches: [ "master" ] - - # Allows you to run this workflow manually from the Actions tab + branches: [main] workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - run: rustup update stable - run: rustup target add wasm32-unknown-unknown - run: cargo build --release --target wasm32-unknown-unknown -p efmt_wasm diff --git a/Cargo.lock b/Cargo.lock index c32469b..97c4b53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,21 +4,20 @@ version = 4 [[package]] name = "aho-corasick" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" dependencies = [ "memchr", ] [[package]] name = "bstr" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f7dc094d718f2e1c1559ad110e27eeaae14a5465d3d56dd6dbd793079fbd530" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" dependencies = [ "memchr", - "regex-automata", "serde_core", ] @@ -28,19 +27,7 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "console" -version = "0.15.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" -dependencies = [ - "encode_unicode", - "libc", - "once_cell", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -80,7 +67,6 @@ dependencies = [ "noargs", "regex", "similar", - "similar-asserts", "unicode-width", ] @@ -92,7 +78,6 @@ dependencies = [ "erl_tokenize", "indoc", "log", - "similar-asserts", ] [[package]] @@ -111,23 +96,17 @@ dependencies = [ "efmt_core", ] -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - [[package]] name = "erl_tokenize" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873ff4b63b4203047056e62d489c303af6337ac126f91a151d63559cf8189214" +checksum = "d5ca90410ef4178323d1e8e4f743b94962d7964d7f410e03a8ca97ab318be798" [[package]] name = "globset" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47d37d2ae4464254884b60ab7071be2b876a9c35b696bd018ddcc76847309cd" +checksum = "07c34a9410465b45bd9787443bc7370f37735bad04b0f0cd57ff1a3186c98988" dependencies = [ "aho-corasick", "bstr", @@ -138,9 +117,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f8a7b8211e695a1d0cd91cace480d4d0bd57667ab10277cc412c5f7f4884f83" +checksum = "00b69833ed729dc5aa7d19541d96d6cf8e9137194207a04916d658e43168402f" dependencies = [ "crossbeam-deque", "globset", @@ -161,17 +140,11 @@ dependencies = [ "rustversion", ] -[[package]] -name = "libc" -version = "0.2.189" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" - [[package]] name = "log" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] name = "memchr" @@ -185,12 +158,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af5b13e43c3b5f1b4f2db60f5f03c803a04f5dd0a6fd44c83b5517ca1ec42ac4" -[[package]] -name = "once_cell" -version = "1.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" - [[package]] name = "proc-macro2" version = "1.0.107" @@ -223,9 +190,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.16" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" dependencies = [ "aho-corasick", "memchr", @@ -270,7 +237,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 3.0.4", ] [[package]] @@ -278,20 +245,6 @@ name = "similar" version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" -dependencies = [ - "bstr", - "unicode-segmentation", -] - -[[package]] -name = "similar-asserts" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b441962c817e33508847a22bd82f03a30cff43642dc2fae8b050566121eb9a" -dependencies = [ - "console", - "similar", -] [[package]] name = "syn" @@ -306,9 +259,9 @@ dependencies = [ [[package]] name = "syn" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f" dependencies = [ "proc-macro2", "quote", @@ -321,12 +274,6 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unicode-segmentation" -version = "1.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" - [[package]] name = "unicode-width" version = "0.2.2" @@ -349,7 +296,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -358,15 +305,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.61.2" @@ -375,67 +313,3 @@ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ "windows-link", ] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/Cargo.toml b/Cargo.toml index 229bc42..014b025 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "efmt" version = "0.21.0" -authors = ["Takeru Ohta "] edition = "2024" license = "MIT OR Apache-2.0" description = "Erlang code formatter" @@ -21,8 +20,5 @@ ignore = "0.4.22" noargs = "0.4.1" unicode-width = "0.2.2" -[dev-dependencies] -similar-asserts = "1" - [workspace] members = ["efmt_core", "efmt_derive", "efmt_wasm"] diff --git a/efmt_core/Cargo.toml b/efmt_core/Cargo.toml index e44fd8a..3a6ede9 100644 --- a/efmt_core/Cargo.toml +++ b/efmt_core/Cargo.toml @@ -2,7 +2,6 @@ name = "efmt_core" version = "0.7.0" edition = "2024" -authors = ["Takeru Ohta "] license = "MIT OR Apache-2.0" description = "Core library for efmt crate" homepage = "https://github.com/sile/efmt" @@ -16,4 +15,3 @@ log = "0.4" [dev-dependencies] indoc = "2" -similar-asserts = "1" diff --git a/efmt_core/src/lib.rs b/efmt_core/src/lib.rs index 55f60b5..a6acbd0 100644 --- a/efmt_core/src/lib.rs +++ b/efmt_core/src/lib.rs @@ -22,11 +22,11 @@ macro_rules! assert_format { ($text:expr, $item_type:ty) => {{ let formatted = $crate::format_text::<$item_type>(&$text).unwrap(); let expected = $text; - similar_asserts::assert_eq!(formatted, expected); + assert_eq!(formatted, expected); }}; ($text:expr, $expected:expr, $item_type:ty) => {{ let formatted = $crate::format_text::<$item_type>(&$text).unwrap(); - similar_asserts::assert_eq!(formatted, $expected); + assert_eq!(formatted, $expected); }}; } diff --git a/efmt_core/src/parse.rs b/efmt_core/src/parse.rs index ec31e69..e24bccf 100644 --- a/efmt_core/src/parse.rs +++ b/efmt_core/src/parse.rs @@ -206,7 +206,7 @@ mod tests { [a, b | #c]. "}; let err = crate::format_text::(text).err().unwrap(); - similar_asserts::assert_eq!( + assert_eq!( err.to_string(), indoc::indoc! {" Parse failed: @@ -224,7 +224,7 @@ mod tests { ?ID([a, b | #c]). "}; let err = crate::format_text::(text).err().unwrap(); - similar_asserts::assert_eq!( + assert_eq!( err.to_string(), indoc::indoc! {" Parse failed: @@ -241,7 +241,7 @@ mod tests { hello "}; let err = crate::format_text::(text).err().unwrap(); - similar_asserts::assert_eq!( + assert_eq!( err.to_string(), indoc::indoc! {" Parse failed: @@ -258,7 +258,7 @@ mod tests { "hello "#}; let err = crate::format_text::(text).err().unwrap(); - similar_asserts::assert_eq!( + assert_eq!( err.to_string(), indoc::indoc! {r#" Tokenize failed: diff --git a/tests/lib.rs b/tests/lib.rs index 6a88300..53e32e4 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -15,7 +15,7 @@ fn format_works() -> crate::Result<()> { } let formatted = efmt::Options::new().format_file::(&path)?; let expected = std::fs::read_to_string(&path)?; - similar_asserts::assert_eq!(formatted, expected, "target={:?}", path); + assert_eq!(formatted, expected, "target={:?}", path); } Ok(()) }