-
Notifications
You must be signed in to change notification settings - Fork 515
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
Various improvements to check_line_lengths.sh
#1667
Merged
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
This is the default bash installed on MacOS. Before this change, the script would only check files in subdirectories, not top-level files.
This also makes them clickable in VSCode. Before: ``` ; ci/check_line_lengths.sh Checking line lengths in all source files <= 100 chars... Offending files and lines: src/SUMMARY.md src/about-this-guide.md src/asm.md src/ast-validation.md src/borrow_check.md src/bug-fix-procedure.md src/cli.md src/closure.md src/compiler-debugging.md src/compiler-src.md src/compiler-team.md src/const-eval.md src/constants.md src/contributing.md src/conventions.md src/crates-io.md src/debugging-support-in-rustc.md src/diagnostics.md src/early-late-bound.md src/external-repos.md src/feature-gate-ck.md src/feature-gates.md src/fuzzing.md src/generic_arguments.md src/generics.md src/getting-started.md 26 : Zulip - you can ask questions in `#wg-rustup` [on Discord][rust-discord]. See [the Community page][community] on 88 : Not all important or beginner work has issue labels. See below for how to find work that isn't labelled. 95 : Some work is too large to be done by a single person. In this case, it's commmon to have "Tracking issues" to co-ordinate the work between contributors. 96 : Here are some example tracking issues where it's easy to pick up a work without a large time commitment: 106 : The [Clippy] project has spent a long time making its contribution process as friendly to newcomers as possible. src/git.md src/hir-debugging.md src/hir.md src/identifiers.md src/implementing_new_features.md src/incrcomp-debugging.md src/lang-items.md src/licenses.md src/llvm-coverage-instrumentation.md src/lowering.md src/macro-expansion.md src/memory.md src/method-lookup.md src/name-resolution.md src/opaque-types-impl-trait-inference.md src/opaque-types-type-alias-impl-trait.md src/overview.md src/panic-implementation.md src/parallel-rustc.md src/param_env.md src/part-2-intro.md src/part-3-intro.md src/part-4-intro.md src/part-5-intro.md src/pat-exhaustive-checking.md src/profile-guided-optimization.md src/profiling.md src/query.md src/rustbot.md src/rustc-driver-getting-diagnostics.md src/rustc-driver-interacting-with-the-ast.md src/rustc-driver.md src/rustdoc-internals.md src/rustdoc.md src/salsa.md src/sanitizers.md src/serialization.md src/stability.md src/stabilization_guide.md src/syntax-intro.md src/test-implementation.md src/the-parser.md src/thir.md src/tracing.md src/ty-fold.md src/ty.md src/type-checking.md src/type-inference.md src/variance.md src/walkthrough.md src/appendix/background.md src/appendix/bibliography.md src/appendix/code-index.md src/appendix/compiler-lecture.md src/appendix/glossary.md src/appendix/humorust.md src/backend/backend-agnostic.md src/backend/codegen.md src/backend/debugging.md src/backend/implicit-caller-location.md src/backend/inline-asm.md src/backend/libs-and-metadata.md src/backend/lowering-mir.md src/backend/monomorph.md src/backend/updating-llvm.md src/borrow_check/moves_and_initialization.md src/borrow_check/region_inference.md src/borrow_check/two_phase_borrows.md src/borrow_check/type_check.md src/building/bootstrapping.md src/building/build-install-distribution-artifacts.md src/building/compiler-documenting.md src/building/how-to-build-and-run.md src/building/new-target.md src/building/prerequisites.md src/building/suggested.md src/const-eval/interpret.md src/diagnostics/diagnostic-items.md src/diagnostics/diagnostic-structs.md src/diagnostics/error-codes.md src/diagnostics/error-guaranteed.md src/diagnostics/lintstore.md src/diagnostics/translation.md src/mir/construction.md src/mir/dataflow.md src/mir/debugging.md src/mir/drop-elaboration.md src/mir/index.md src/mir/optimizations.md src/mir/passes.md src/mir/visitor.md src/notification-groups/about.md src/notification-groups/arm.md src/notification-groups/cleanup-crew.md src/notification-groups/llvm.md src/notification-groups/risc-v.md src/notification-groups/windows.md src/profiling/with_perf.md src/profiling/wpa_profiling.md src/queries/incremental-compilation-in-detail.md src/queries/incremental-compilation.md src/queries/query-evaluation-model-in-detail.md src/solve/canonicalization.md src/solve/coinduction.md src/solve/the-solver.md src/solve/trait-solving.md src/tests/adding.md src/tests/ci.md src/tests/compiletest.md src/tests/crater.md src/tests/docker.md src/tests/headers.md src/tests/intro.md src/tests/perf.md src/tests/running.md src/tests/ui.md src/traits/caching.md src/traits/canonical-queries.md src/traits/chalk.md src/traits/goals-and-clauses.md src/traits/hrtb.md src/traits/lowering-to-logic.md src/traits/resolution.md src/traits/specialization.md src/borrow_check/moves_and_initialization/move_paths.md src/borrow_check/region_inference/closure_constraints.md src/borrow_check/region_inference/constraint_propagation.md src/borrow_check/region_inference/error_reporting.md src/borrow_check/region_inference/lifetime_parameters.md src/borrow_check/region_inference/member_constraints.md src/borrow_check/region_inference/placeholders_and_universes.md 5 offending lines found. ``` After: ``` ; ci/check_line_lengths.sh Checking line lengths in all source files <= 100 chars... Offending files and lines: src/getting-started.md:26 : Zulip - you can ask questions in `#wg-rustup` [on Discord][rust-discord]. See [the Community page][community] on src/getting-started.md:88 : Not all important or beginner work has issue labels. See below for how to find work that isn't labelled. src/getting-started.md:95 : Some work is too large to be done by a single person. In this case, it's commmon to have "Tracking issues" to co-ordinate the work between contributors. src/getting-started.md:96 : Here are some example tracking issues where it's easy to pick up a work without a large time commitment: src/getting-started.md:106 : The [Clippy] project has spent a long time making its contribution process as friendly to newcomers as possible. 5 offending lines found. ``` ```
This allows using tab completion to run the script. Before, `ci/check` would stop because of the ambiguity between `check-in.sh` and `check_line_lengths.sh`. This also takes the liberty of fixing up the powershell example to work without changes.
JohnTitor
approved these changes
Apr 9, 2023
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.
Makes sense!
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Apr 11, 2023
Update books ## rust-lang/book 1 commits in 0510ca84c2ce6bf93c4ccf9248756e9e4fd00b12..c06006157b14b3d47b5c716fc392b77f3b2e21ce 2023-04-03 15:31:55 UTC to 2023-04-03 15:31:55 UTC - Fix grammar (rust-lang/book#3600) ## rust-lang/reference 3 commits in 3c47807a3131b3c7cacb508f52632078d253cd0a..1f8dc727e94ae4ef92adf70df979521a1ea1143e 2023-04-09 14:04:53 UTC to 2023-03-29 13:21:47 UTC - Explain typos in `asm!` can be unsound (rust-lang/reference#1344) - Fix coding style in example: add space between module name and bracket (rust-lang/reference#1347) - redundant word removed (rust-lang/reference#1346) ## rust-lang/rust-by-example 1 commits in ba84bf35d0f17d404003349309201654d25f61af..31961fe22521a779070a44a8f30a2b00a20b6212 2023-04-10 13:06:34 UTC to 2023-04-10 13:06:34 UTC - Add clarity to name of file being used in library example. (rust-lang/rust-by-example#1697) ## rust-lang/rustc-dev-guide 8 commits in fca8af6c154c6cde2512f1331cf2704f214a818e..6337ed17fb8dcd918d78b7d97d213e923530337c 2023-04-10 14:23:05 UTC to 2023-04-06 00:29:18 UTC - fix markup (rust-lang/rustc-dev-guide#1670) - Reorganize "Getting Started" and add a "What should I work on?" section (rust-lang/rustc-dev-guide#1665) - Clarify cfg(bootstrap) docs (rust-lang/rustc-dev-guide#1669) - Link to forge instead of duplicating toolstate info (rust-lang/rustc-dev-guide#1664) - Improve the landing page for contributing to the libstd docs (rust-lang/rustc-dev-guide#1666) - Various improvements to `check_line_lengths.sh` (rust-lang/rustc-dev-guide#1667) - Document how to ignore specific files in a diff (rust-lang/rustc-dev-guide#1668) - mention `git clone --depth 1` (rust-lang/rustc-dev-guide#1663)
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Apr 11, 2023
Update books ## rust-lang/book 1 commits in 0510ca84c2ce6bf93c4ccf9248756e9e4fd00b12..c06006157b14b3d47b5c716fc392b77f3b2e21ce 2023-04-03 15:31:55 UTC to 2023-04-03 15:31:55 UTC - Fix grammar (rust-lang/book#3600) ## rust-lang/reference 3 commits in 3c47807a3131b3c7cacb508f52632078d253cd0a..1f8dc727e94ae4ef92adf70df979521a1ea1143e 2023-04-09 14:04:53 UTC to 2023-03-29 13:21:47 UTC - Explain typos in `asm!` can be unsound (rust-lang/reference#1344) - Fix coding style in example: add space between module name and bracket (rust-lang/reference#1347) - redundant word removed (rust-lang/reference#1346) ## rust-lang/rust-by-example 1 commits in ba84bf35d0f17d404003349309201654d25f61af..31961fe22521a779070a44a8f30a2b00a20b6212 2023-04-10 13:06:34 UTC to 2023-04-10 13:06:34 UTC - Add clarity to name of file being used in library example. (rust-lang/rust-by-example#1697) ## rust-lang/rustc-dev-guide 8 commits in fca8af6c154c6cde2512f1331cf2704f214a818e..6337ed17fb8dcd918d78b7d97d213e923530337c 2023-04-10 14:23:05 UTC to 2023-04-06 00:29:18 UTC - fix markup (rust-lang/rustc-dev-guide#1670) - Reorganize "Getting Started" and add a "What should I work on?" section (rust-lang/rustc-dev-guide#1665) - Clarify cfg(bootstrap) docs (rust-lang/rustc-dev-guide#1669) - Link to forge instead of duplicating toolstate info (rust-lang/rustc-dev-guide#1664) - Improve the landing page for contributing to the libstd docs (rust-lang/rustc-dev-guide#1666) - Various improvements to `check_line_lengths.sh` (rust-lang/rustc-dev-guide#1667) - Document how to ignore specific files in a diff (rust-lang/rustc-dev-guide#1668) - mention `git clone --depth 1` (rust-lang/rustc-dev-guide#1663)
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.
Add compatibility for bash 3, which is the default on MacOS
Make error messages less verbose and clickable in VSCode
Rename check_line_lengths.sh to lengthcheck.sh
The rename allows using tab completion to run the script. Before,
ci/check
would stop because of the ambiguity between
check-in.sh
andcheck_line_lengths.sh
.Fix the powershell example in the readme to work without changes.