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 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 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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 562a4ead86..082f135fb4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,9 @@ 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. `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. 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 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 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"