-
Notifications
You must be signed in to change notification settings - Fork 315
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
Add CI lint checking to enforce rustfmt code formatting. #594
Merged
Conversation
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
Per @reset's request, I'm going to strip the Builder components out of this PR so we can deal with that after. Standby for merging this |
767c8e7
to
f9c638f
Compare
@fnichol appreciate that! |
5b00a4e
to
16b84f3
Compare
☔ The latest upstream changes (presumably 0bab710) made this pull request unmergeable. Please resolve the merge conflicts. |
The script `support/ci/lint.sh` has 4 detection modes to trigger slightly different behavior depending on the context or use case: * If a `LINT_ALL` environment variable is set, all `*.rs` under the `components/` directory will be checked with `rustfmt`. This may only be useful when upgrading the version of `rustfmt` as it will also flag any currently vendored crates also under `./components/`. * If there are unstaged files, check all Rust files that are unstaged. This is most useful when actively developing a commit or feature. * If there are staged files, check all Rust files that are staged (also known as cached). This is most useful as a pre-commit activity before writing a commit. * Otherwise, use the last commit (i.e. `HEAD`) to select the files to check. This is most useful in a CI environment where the last commit is assumed to contain most of the work. If a `TRAVIS_COMMIT_RANGE` environment varible is present, this will be used instead to get all files for the pull request under review. Signed-off-by: Fletcher Nichol <[email protected]>
Signed-off-by: Fletcher Nichol <[email protected]>
16b84f3
to
10d38bf
Compare
The formatting, it is so enforced |
📌 Commit 10d38bf has been approved by |
thesentinels
pushed a commit
that referenced
this pull request
Jun 1, 2016
The script `support/ci/lint.sh` has 4 detection modes to trigger slightly different behavior depending on the context or use case: * If a `LINT_ALL` environment variable is set, all `*.rs` under the `components/` directory will be checked with `rustfmt`. This may only be useful when upgrading the version of `rustfmt` as it will also flag any currently vendored crates also under `./components/`. * If there are unstaged files, check all Rust files that are unstaged. This is most useful when actively developing a commit or feature. * If there are staged files, check all Rust files that are staged (also known as cached). This is most useful as a pre-commit activity before writing a commit. * Otherwise, use the last commit (i.e. `HEAD`) to select the files to check. This is most useful in a CI environment where the last commit is assumed to contain most of the work. If a `TRAVIS_COMMIT_RANGE` environment varible is present, this will be used instead to get all files for the pull request under review. Signed-off-by: Fletcher Nichol <[email protected]> Pull request: #594 Approved by: fnichol
thesentinels
pushed a commit
that referenced
this pull request
Jun 1, 2016
Signed-off-by: Fletcher Nichol <[email protected]> Pull request: #594 Approved by: fnichol
☀️ Test successful - travis |
jtimberman
pushed a commit
that referenced
this pull request
Jun 12, 2016
The script `support/ci/lint.sh` has 4 detection modes to trigger slightly different behavior depending on the context or use case: * If a `LINT_ALL` environment variable is set, all `*.rs` under the `components/` directory will be checked with `rustfmt`. This may only be useful when upgrading the version of `rustfmt` as it will also flag any currently vendored crates also under `./components/`. * If there are unstaged files, check all Rust files that are unstaged. This is most useful when actively developing a commit or feature. * If there are staged files, check all Rust files that are staged (also known as cached). This is most useful as a pre-commit activity before writing a commit. * Otherwise, use the last commit (i.e. `HEAD`) to select the files to check. This is most useful in a CI environment where the last commit is assumed to contain most of the work. If a `TRAVIS_COMMIT_RANGE` environment varible is present, this will be used instead to get all files for the pull request under review. Signed-off-by: Fletcher Nichol <[email protected]> Pull request: #594 Approved by: fnichol
jtimberman
pushed a commit
that referenced
this pull request
Jun 12, 2016
Signed-off-by: Fletcher Nichol <[email protected]> Pull request: #594 Approved by: fnichol
raskchanky
pushed a commit
that referenced
this pull request
Apr 16, 2019
Signed-off-by: Fletcher Nichol <[email protected]> Pull request: #594 Approved by: fnichol
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change applies formatting from a stock
rustfmt
0.5.0 configuration (i.e. no project overrides) and introduces a linting script that runs after unit tests have passed. If runningrustfmt
against Rust files in the changeset cause a diff, then the build fails with a report.The script
support/ci/lint.sh
has 4 detection modes to trigger slightly different behavior depending on the context or use case:LINT_ALL
environment variable is set, all*.rs
under thecomponents/
directory will be checked withrustfmt
. This may only be useful when upgrading the version ofrustfmt
as it will also flag any currently vendored crates also under./components/
.HEAD
) to select the files to check. This is most useful in a CI environment where the last commit is assumed to contain most of the work. If aTRAVIS_COMMIT_RANGE
environment varible is present, this will be used instead to get all files for the pull request under review.