-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add rustfmt imports_granularity #1077
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8c469e1
feat: add rustfmt imports_granularity
qiweiii 0548911
fix: use regular nightly image
qiweiii a8565fe
fix: add +nightly to rust fmt commands
qiweiii 4c7f4cc
fix: try remove sudo for nightly image
qiweiii 62a183b
fix: ci apt install clang with yes flag
qiweiii d61aa0d
fix: add rust-toolchain
qiweiii 1a6f8d1
fix: clippy error after using nightly
qiweiii 0a93b3e
feat: add more rustfmt options
qiweiii b935fc5
fix: remove rust-toolchain
qiweiii 8ae82c0
fix: ci separate rustfmt and clippy
qiweiii c4b24e2
Revert "fix: clippy error after using nightly"
qiweiii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this now, I assume here
clippy
is running with the nightly version, but because we don't pin Trin to nightly there may be some discrepancies between nightly clippy and stable clippy in the future.It would be better if we split the
lint
job tocargo-fmt
andcargo-clippy
and run clippy with the default stable toolchain.If you don't feel like doing it in this PR, we can leave it for a future fix (this will not be a blocker for merging this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could try it in this PR, seems like a simple change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all done!