From 75c357ee216ddafbc1d9d6bd23846ec38122ab7a Mon Sep 17 00:00:00 2001 From: Tom Milligan Date: Sun, 15 Sep 2024 13:57:20 +0100 Subject: [PATCH 1/5] chore: remove ci from on push --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 9f43033..d9106dc 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -on: [push, pull_request] +on: [pull_request] name: check From 9a3f6835008db89368703adcce1523268e65b6fb Mon Sep 17 00:00:00 2001 From: Tom Milligan Date: Wed, 11 Dec 2024 09:27:19 +0000 Subject: [PATCH 2/5] chore: upgrade github ci actions --- .github/workflows/check.yml | 27 +++++++++++---------------- .github/workflows/publish.yml | 7 +++---- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d9106dc..b1ded8a 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache build files - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/bin/ @@ -23,19 +23,16 @@ jobs: ~/.cargo/git/db/ target/ key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-v3 + - name: Install toolchain (nightly) + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly + # Install stable toolchain last, so it will be set as default - name: Install toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: stable - override: true - profile: minimal components: clippy, rustfmt - - name: Install toolchain (nightly) - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: false - profile: minimal - name: Run check script run: ./scripts/check @@ -68,9 +65,9 @@ jobs: continue-on-error: ${{ matrix.experimental }} steps: - name: Checkout sources - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache build files - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo/bin/ @@ -80,10 +77,8 @@ jobs: target/ key: test-${{ matrix.os }}-${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.toml') }}-v2 - name: Install toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - override: true - profile: minimal - name: Run tests run: cargo test --package pretty_assertions diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7194233..4f27a3c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,8 +9,8 @@ jobs: publish: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/registry @@ -21,10 +21,9 @@ jobs: # We reuse the cache from our detailed test environment, if available key: detailed-test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} - name: Install toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: toolchain: stable - override: true - name: Publish crate env: CARGO_LOGIN_TOKEN: ${{ secrets.CARGO_LOGIN_TOKEN }} From deb0ceaf0e5afa482be55bf4838ec9acb7782bf2 Mon Sep 17 00:00:00 2001 From: Tom Milligan Date: Wed, 11 Dec 2024 13:47:16 +0000 Subject: [PATCH 3/5] chore: fix clippy --- pretty_assertions/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pretty_assertions/src/lib.rs b/pretty_assertions/src/lib.rs index 39db5cb..0d4a998 100644 --- a/pretty_assertions/src/lib.rs +++ b/pretty_assertions/src/lib.rs @@ -117,7 +117,7 @@ where } } -impl<'a, TLeft, TRight> Display for Comparison<'a, TLeft, TRight> +impl Display for Comparison<'_, TLeft, TRight> where TLeft: Debug + ?Sized, TRight: Debug + ?Sized, @@ -191,7 +191,7 @@ where } } -impl<'a, TLeft, TRight> Display for StrComparison<'a, TLeft, TRight> +impl Display for StrComparison<'_, TLeft, TRight> where TLeft: AsRef + ?Sized, TRight: AsRef + ?Sized, From c1208bd921b344e424f2e442f85f8352697c6db2 Mon Sep 17 00:00:00 2001 From: Nik Revenco <154856872+nik-rev@users.noreply.github.com> Date: Thu, 8 May 2025 18:41:06 +0100 Subject: [PATCH 4/5] docs: add tip on how to enforce using `pretty_assertions` macros over `std` --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 7bbb4cc..be32ac6 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,16 @@ Also add `#[cfg(test)]` to your `use` statements, like this: use pretty_assertions::{assert_eq, assert_ne}; ``` +If you want to enforce usage of `pretty_assertions` macros over `std`, add the following to `clippy.toml`: + +```rs +disallowed-macros = [ + { path = "std::assert_ne", reason = "use `pretty_assertions::assert_ne` instead" }, + { path = "std::assert_eq", reason = "use `pretty_assertions::assert_eq` instead" }, + { path = "std::assert_matches", reason = "use `pretty_assertions::assert_matches` instead" }, +] +``` + ## Notes - Since `Rust 2018` edition, you need to declare From d54495321df79ca6faefa38f22a565742fbe7c55 Mon Sep 17 00:00:00 2001 From: Dominik Kellner Date: Mon, 26 May 2025 20:37:58 +0200 Subject: [PATCH 5/5] build: Increase portability of shell scripts `/usr/bin/env bash` will search $PATH for `bash` and execute it instead of relying on it being installed in `/bin/bash`. E.g. on NixOS and several BSDs this is not the case. --- scripts/check | 2 +- scripts/cover | 2 +- scripts/install | 2 +- scripts/publish | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/check b/scripts/check index 07b1714..4851661 100755 --- a/scripts/check +++ b/scripts/check @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail diff --git a/scripts/cover b/scripts/cover index 1e62372..834b9e8 100755 --- a/scripts/cover +++ b/scripts/cover @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail diff --git a/scripts/install b/scripts/install index c4423da..b995ca1 100755 --- a/scripts/install +++ b/scripts/install @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -exuo pipefail diff --git a/scripts/publish b/scripts/publish index 21af80d..1ffacf2 100755 --- a/scripts/publish +++ b/scripts/publish @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euxo pipefail pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy