Skip to content
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 3 commits into from
Apr 9, 2023

Commits on Apr 8, 2023

  1. Add compatibility with Bash 3.0

    This is the default bash installed on MacOS. Before this change, the
    script would only check files in subdirectories, not top-level files.
    jyn514 committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    5038020 View commit details
    Browse the repository at this point in the history
  2. Make line length errors easier to read

    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.
    ```
    ```
    jyn514 committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    012113b View commit details
    Browse the repository at this point in the history
  3. Rename check_line_lengths.sh to lengthcheck.sh

    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.
    jyn514 committed Apr 8, 2023
    Configuration menu
    Copy the full SHA
    50666f8 View commit details
    Browse the repository at this point in the history