From 3da0fc0a016e53843d68d03199b58b14523f4d94 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 10:39:17 -0600 Subject: [PATCH 1/8] chore: Delegate ignores to user ignores --- .gitignore | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.gitignore b/.gitignore index fa645402e3..eb5a316cbd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,22 +1 @@ -# Project specific stuff target -# rustfmt -*.bk - -# Editor Stuff -*.sublime-project -*.sublime-workspace -.*.swp -*.bak -*~ -.vscode - -# System stuff -.DS_Store -.Spotlight-V100 -.Trashes -Thumbs.db -ehthumbs.db -Desktop.ini -$RECYCLE.BIN/ -.directory From b0afcce3d6d44f9b22ac29449e0d9043e038c7de Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 10:40:26 -0600 Subject: [PATCH 2/8] chore: Use default rustfmt --- rustfmt.toml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 rustfmt.toml diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index 32a9786fa1..0000000000 --- a/rustfmt.toml +++ /dev/null @@ -1 +0,0 @@ -edition = "2018" From 88d114d972f52e8bc0c56baf87a887eb12b070a8 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 10:41:39 -0600 Subject: [PATCH 3/8] chore: Rely on rustfmt for config --- .editorconfig | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 3c1f41bdcc..0000000000 --- a/.editorconfig +++ /dev/null @@ -1,25 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 4 - -[*.rs] -indent_style = space -indent_size = 4 - -[*.toml] -indent_style = space -indent_size = 4 - -[*.md] -trim_trailing_whitespace = false From 676cc42f4fc428a087ce824b406572229a1e55e8 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 10:41:53 -0600 Subject: [PATCH 4/8] chore: Remove bors --- bors.toml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 bors.toml diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 4f31a3746b..0000000000 --- a/bors.toml +++ /dev/null @@ -1,7 +0,0 @@ -status = [ - "build (ubuntu-latest, stable)", - "build (ubuntu-latest, nightly)", - "build (windows-latest, stable)", - "build (macOS-latest, stable)", -] -use_squash_merge = true From 74a7bea4d3ab50a1a5b18153a998045dd977c6dc Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 10:44:05 -0600 Subject: [PATCH 5/8] docs: Generalize copyright statement --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index ac009d59ed..aa7fdf131d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Without Boats, Pascal Hertleif +Copyright (c) Individual contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 5ce330057253527c0b21ca7b21371e06e401b516 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 10:44:53 -0600 Subject: [PATCH 6/8] docs(contrib): Remove reference to gitter --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 562a4ead86..4c115972f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ Thanks for your interest - we gratefully welcome contributions. -Questions can be asked in [issues](https://github.com/killercup/cargo-edit/issues), or on [Gitter](https://gitter.im/cargo-edit/Lobby). +Questions can be asked in [issues](https://github.com/killercup/cargo-edit/issues). To help us help you get pull requests merged quickly and smoothly, open an issue before submitted large changes. Please keep the contents of pull requests and commits short. Commit messages should include the intent of the commit. From b1575a9e3ca596004ca6318e8272fa4d432ffa63 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 10:46:02 -0600 Subject: [PATCH 7/8] docs(contrib): Remove really old links --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c115972f4..082f135fb4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,4 +6,4 @@ To help us help you get pull requests merged quickly and smoothly, open an issue `cargo-edit` has a moderately comprehensive test suite. Contributions that add/improve tests are awesome. Please add tests for every change. -`cargo-edit` uses [`rustfmt-nightly`](https://github.com/rust-lang-nursery/rustfmt) for formatting and [`clippy`](https://github.com/rust-lang-nursery/rust-clippy) for linting. +`cargo-edit` uses `rustfmt` for formatting and `clippy` for linting. From 7b271f61242d07cf747f9ab14b9a2ad1a39116f8 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 12 Feb 2025 11:00:18 -0600 Subject: [PATCH 8/8] chore(ci): Align closer to epage/_rust template --- .github/workflows/build.yml | 129 +++++++++++++++++++---------- .github/workflows/post-release.yml | 2 +- 2 files changed, 88 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d1539671c..02e818f18d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,57 +1,102 @@ name: build +permissions: + contents: read + on: [push, pull_request] +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + CLICOLOR: 1 + jobs: build: - runs-on: ${{ matrix.os }} + permissions: + contents: none + name: CI + needs: [test, lockfile, rustfmt, clippy] + runs-on: ubuntu-latest + if: "always()" + steps: + - name: Failed + run: exit 1 + if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')" + test: + name: Test strategy: - fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - toolchain: [stable] + os: ["ubuntu-latest", "windows-latest", "macos-latest"] + rust: ["stable"] + continue-on-error: ${{ matrix.rust != 'stable' }} + runs-on: ${{ matrix.os }} steps: - - name: Install latest nightly - uses: actions-rs/toolchain@v1 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - toolchain: ${{ matrix.toolchain }} - override: true - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 + toolchain: ${{ matrix.rust }} + - uses: Swatinem/rust-cache@v2 - name: Build - run: cargo build --verbose - continue-on-error: ${{ matrix.toolchain != 'stable' }} - - name: Run tests - run: cargo test --verbose - continue-on-error: ${{ matrix.toolchain != 'stable' }} - - clippy: - name: clippy (ubuntu-latest, stable) + run: cargo test --no-run + - name: Test + run: cargo test + lockfile: runs-on: ubuntu-latest steps: - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: clippy - - name: Checkout sources - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1 - - name: Cargo Clippy - run: cargo clippy -- -D warnings -A deprecated - - fmt: - name: fmt (ubuntu-latest, stable) + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + - uses: Swatinem/rust-cache@v2 + - name: "Is lockfile updated?" + run: cargo update --workspace --locked + rustfmt: + name: rustfmt + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: rustfmt + - uses: Swatinem/rust-cache@v2 + - name: Check formatting + run: cargo fmt --all -- --check + clippy: + name: clippy runs-on: ubuntu-latest + permissions: + security-events: write # to upload sarif results steps: - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: rustfmt - - name: Checkout sources - uses: actions/checkout@v2 - - name: Check Formatting - run: cargo fmt --all -- --check + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy + - uses: Swatinem/rust-cache@v2 + - name: Install SARIF tools + run: cargo install clippy-sarif --locked + - name: Install SARIF tools + run: cargo install sarif-fmt --locked + - name: Check + run: > + cargo clippy --workspace --all-features --all-targets --message-format=json + | clippy-sarif + | tee clippy-results.sarif + | sarif-fmt + continue-on-error: true + - name: Upload + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: clippy-results.sarif + wait-for-processing: true + - name: Report status + run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index f4c23f1a44..5a73deb4c0 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -24,7 +24,7 @@ jobs: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV echo "version is: ${{ env.RELEASE_VERSION }}" - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 1 - name: Generate Release Notes