-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add rustfmt config to format imports and comments (#1077)
* feat: add rustfmt imports_granularity * fix: use regular nightly image * fix: add +nightly to rust fmt commands * fix: try remove sudo for nightly image * fix: ci apt install clang with yes flag * fix: add rust-toolchain * fix: clippy error after using nightly * feat: add more rustfmt options * fix: remove rust-toolchain * fix: ci separate rustfmt and clippy * Revert "fix: clippy error after using nightly" This reverts commit 1a6f8d1.
- Loading branch information
Showing
117 changed files
with
972 additions
and
776 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,17 @@ commands: | |
- run: | ||
name: Install libclang for rocksdb | ||
command: sudo apt install clang | ||
install-depends-nightly: | ||
steps: | ||
- run: | ||
name: Prepare for apt upgrades | ||
command: apt update | ||
- run: | ||
name: Install libssl-dev for openssl-sys | ||
command: apt install -y libssl-dev | ||
- run: | ||
name: Install libclang for rocksdb | ||
command: apt install -y clang | ||
orbs: | ||
rust: circleci/[email protected] | ||
win: circleci/[email protected] | ||
|
@@ -49,6 +60,9 @@ executors: | |
IMAGE_NAME: portalnetwork/trin | ||
docker: | ||
- image: cimg/rust:1.71.1 | ||
docker-nightly: | ||
docker: | ||
- image: rustlang/rust:nightly | ||
jobs: | ||
docker-build: | ||
resource_class: xlarge | ||
|
@@ -118,30 +132,41 @@ jobs: | |
command: | | ||
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin | ||
docker push $IMAGE_NAME:latest-bridge | ||
lint: | ||
description: | | ||
Check linting with Clippy and rustfmt. | ||
resource_class: xlarge | ||
executor: | ||
name: rust/default | ||
tag: 1.71.1 | ||
environment: | ||
RUSTFLAGS: '-D warnings' | ||
RUST_LOG: 'debug' | ||
steps: | ||
- checkout | ||
- install-depends | ||
- run: | ||
name: Run rustfmt | ||
command: cargo fmt --all -- --check | ||
- run: | ||
name: Install Clippy | ||
command: rustup component add clippy | ||
- setup-and-restore-sccache-cache | ||
- run: | ||
name: Run Clippy | ||
command: cargo clippy --all --all-targets --all-features --no-deps -- --deny warnings | ||
- save-sccache-cache | ||
cargo-fmt: | ||
description: | | ||
Check linting with rustfmt. | ||
resource_class: xlarge | ||
executor: docker-nightly | ||
environment: | ||
RUSTFLAGS: "-D warnings" | ||
RUST_LOG: "debug" | ||
steps: | ||
- checkout | ||
- install-depends-nightly | ||
- run: | ||
name: Run rustfmt | ||
command: cargo +nightly fmt --all -- --check | ||
cargo-clippy: | ||
description: | | ||
Check linting with Clippy. | ||
resource_class: xlarge | ||
executor: | ||
name: rust/default | ||
tag: 1.71.1 | ||
environment: | ||
RUSTFLAGS: "-D warnings" | ||
RUST_LOG: "debug" | ||
steps: | ||
- checkout | ||
- install-depends | ||
- run: | ||
name: Install Clippy | ||
command: rustup component add clippy | ||
- setup-and-restore-sccache-cache | ||
- run: | ||
name: Run Clippy | ||
command: cargo clippy --all --all-targets --all-features --no-deps -- --deny warnings | ||
- save-sccache-cache | ||
build: | ||
description: | | ||
Build the crate. | ||
|
@@ -150,8 +175,8 @@ jobs: | |
name: rust/default | ||
tag: 1.71.1 | ||
environment: | ||
RUSTFLAGS: '-D warnings' | ||
RUST_LOG: 'debug' | ||
RUSTFLAGS: "-D warnings" | ||
RUST_LOG: "debug" | ||
steps: | ||
- checkout | ||
- install-depends | ||
|
@@ -167,8 +192,8 @@ jobs: | |
name: win/default | ||
size: xlarge | ||
environment: | ||
RUSTFLAGS: '-D warnings' | ||
RUST_LOG: 'debug' | ||
RUSTFLAGS: "-D warnings" | ||
RUST_LOG: "debug" | ||
steps: | ||
- checkout | ||
- run: | ||
|
@@ -187,8 +212,8 @@ jobs: | |
name: rust/default | ||
tag: 1.71.1 | ||
environment: | ||
RUSTFLAGS: '-D warnings' | ||
RUST_LOG: 'debug' | ||
RUSTFLAGS: "-D warnings" | ||
RUST_LOG: "debug" | ||
steps: | ||
- checkout | ||
- install-depends | ||
|
@@ -204,8 +229,8 @@ jobs: | |
image: ubuntu-2204:current | ||
resource_class: xlarge | ||
environment: | ||
RUSTFLAGS: '-D warnings' | ||
RUST_LOG: 'debug' | ||
RUSTFLAGS: "-D warnings" | ||
RUST_LOG: "debug" | ||
steps: | ||
- checkout | ||
- run: | ||
|
@@ -276,7 +301,8 @@ workflows: | |
filters: | ||
branches: | ||
only: master | ||
- lint | ||
- cargo-fmt | ||
- cargo-clippy | ||
- build | ||
- test | ||
- check-windows | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.