about summary refs log tree commit diff
path: root/src/tools/tidy
AgeCommit message (Collapse)AuthorLines
2023-11-07bump some depsklensy-1/+0
drop num_cpus from rust-installer as not used update rayon, rayon-core, which drops it's deps on num_cpus and crossbeam-channel (for bootstrap too) (https://github.com/rayon-rs/rayon/blob/v1.8.0/RELEASES.md) update erro, which drops errno-dragonfly (https://github.com/lambda-fairy/rust-errno/blob/5341791935df601306ffc57a665763c4ecd72755/CHANGELOG.md)
2023-11-06Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwcobors-0/+1
enable parallel rustc front end in nightly builds Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does: 1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option. 2. Set it up to serial front end for beta/stable builds via bootstrap. 3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel. r? `@oli-obk` cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06use portable AtomicU64 for powerPC and MIPSSparrowLii-0/+1
2023-11-04Auto merge of #117566 - weihanglo:update-cargo, r=weihanglobors-1/+0
Update cargo 8 commits in b4d18d4bd3db6d872892f6c87c51a02999b80802..65e297d1ec0dee1a74800efe600b8dc163bcf5db 2023-10-31 18:19:10 +0000 to 2023-11-03 20:56:31 +0000 - fix(cli): Clarify --test is for targets, not test functions (rust-lang/cargo#12915) - Updating "features" documentation to add a note about the new limit on number of features (rust-lang/cargo#12913) - fix: merge `trim-paths` from different profiles (rust-lang/cargo#12908) - Add regression test for issue 6915: features and transitive dev deps (rust-lang/cargo#12907) - chore(deps): update rust crate gix to 0.55.2 (rust-lang/cargo#12906) - chore(deps): update compatible (rust-lang/cargo#12905) - docs(ref): Fix open-semver-range issue link (rust-lang/cargo#12904) - docs(ref): Highlight commands to answer dep resolution questions (rust-lang/cargo#12903) r? ghost
2023-11-04Update cargoWeihang Lo-1/+0
Remove license exception of `byteyarn` as it is no longer used
2023-11-04Auto merge of #115274 - bjorn3:tidy_improvements, r=davidtwcobors-81/+183
Run tidy license checker on more workspaces The license checker didn't run on several workspaces before this PR. The same applied to the "external package sources" check. There were also two missing lockfiles which I have added now.
2023-11-02Add UI tests for values accepted by `-C symbol-mangling-version`Zalathar-1/+1
2023-10-31Use derivative for CloneMichael Goulet-0/+1
2023-10-28Auto merge of #117149 - nnethercote:tidy-alphabetical-unit-tests, r=Nilstriebbors-36/+262
tidy: add unit tests for alphabetical checks I discovered there aren't any tests while working on #117068. r? `@Nilstrieb`
2023-10-28Disable tidy dep check for a couple more unvendored projectbjorn3-3/+3
2023-10-25tidy: add unit tests for alphabetical markers.Nicholas Nethercote-25/+238
This requires introducing `tidy_error_ext!` as an alternative to `tidy_error!`. It is passed a closure that is called for an error. This lets tests capture tidy error messages in a buffer instead of printing them to stderr. It also requires pulling part of `check` out into a new function `check_lines`, so that tests can pass in an iterator over some strings instead of a file.
2023-10-25tidy: some minor improvements.Nicholas Nethercote-9/+20
- Tweak some comments. - No need to do the `concat!` trick on `START_MARKER` because it's immediately followed by `END_MARKER`. - Fix an off-by-one error in the line number for an error message. - When a second start marker is found without an intervening end marker, after giving an error, treat it as though it ends the section. It's hard to know exactly what to do in this case, but it makes unit testing this case a little simpler (in the next commit). - If an end marker occurs without a preceding start marker, issue an error.
2023-10-25tidy: skip lines starting with `#` in alphabetical check.Nicholas Nethercote-3/+8
These are comment lines in `Cargo.toml` files. But exclude lines starting with `#!` from the skipping, because we want to check them. (Rust `#![feature(...)]` lines.) Also allow empty lines, which are occasionally useful.
2023-10-25Fix a bug in tidy's alphabetical checking.Nicholas Nethercote-17/+14
Currently, if a `tidy-alphabetical-end` marker appears on the last line of a file, tidy will erroneously issue a "reach end of file expecting `tidy-alphabetical-end`" error. This is because it uses `take_while` within `check_section`, which consumes the line with the end marker, and then after `check_section` returns `check` peeks for at least one more line, which won't be there is the marker was on the last line. This commit fixes the problem, by removing the use of `take_while`, and doing the "reached end of file" test within `check_section` without using `peek`. It also renames `{START,END}_COMMENT` as `{START,END}_MARKER`, which is a more appropriate name.
2023-10-23coverage: Add UI tests for values accepted by `-Cinstrument-coverage`Zalathar-1/+1
2023-10-19Allow to run filecheck in mir-opt tests.Camille GILLOT-1/+2
2023-10-17Auto merge of #116477 - nnethercote:tidy-alpha-deps, r=wesleywiserbors-2/+2
Use tidy to enforce alphabetical dependency ordering I get annoyed when dependencies in `Cargo.toml` files are not in alphabetical order. The [style guide](https://github.com/rust-lang/rust/blob/master/src/doc/style-guide/src/cargo.md) agrees with me. There are ongoing efforts to provide linting/formatting of `Cargo.toml` files, e.g. https://github.com/rust-lang/rustfmt/pull/5240, https://crates.io/crates/cargo-toml-lint, and https://github.com/TimonPost/cargo-toml-format. But it's far from clear what's the right approach. So this PR does something very simple: it uses the order checking already present in tidy. This allows incremental application of ordering, starting right now, and avoiding the need for any kind of all-at-once conversion. If we do end up using some more comprehensive `Cargo.toml` linting/formatting solution in the future, the `tidy-alphabetical` lines will be easy to remove. r? `@wesleywiser`
2023-10-16Rename `ACTIVE_FEATURES` as `UNSTABLE_FEATURES`.Nicholas Nethercote-8/+8
It's a better name, and lets "active features" refer to the features that are active in a particular program, due to being declared or enabled by the edition. The commit also renames `Features::enabled` as `Features::active` to match this; I changed my mind and have decided that "active" is a little better thatn "enabled" for this, particularly because a number of pre-existing comments use "active" in this way. Finally, the commit renames `Status::Stable` as `Status::Accepted`, to match `ACCEPTED_FEATURES`.
2023-10-10Update license for notifybjorn3-1/+1
2023-10-10Update status for the backtrace and stdarch exceptionsbjorn3-2/+2
2023-10-10Disable tidy license checker for cg_gcc until it's deps are vendoredbjorn3-10/+4
2023-10-10Ensure tidy never updates Cargo.lockbjorn3-2/+3
Otherwise the results may be outdated compared to a build at a later time. Also disable checking for the backtrace workspace until Cargo.lock is committed.
2023-10-10Check more workspacesbjorn3-0/+23
2023-10-10Give an error instead of a panic if the lockfile is missingbjorn3-0/+10
2023-10-10Clarify some license exceptionsbjorn3-13/+10
2023-10-10Check for external package sources in all workspacesbjorn3-26/+38
2023-10-10Run licence checks for cg_gcc and rust-analyzerbjorn3-1/+28
2023-10-10Make it easier to check licenses for new workspacesbjorn3-52/+60
2023-10-10Check permitted dependencies for rustc-mainbjorn3-1/+2
Rather than just for rustc_driver. rustc-main also depends on rustc_smir which may get unique dependencies in the future.
2023-10-10Split out check_runtime_license_exceptionsbjorn3-19/+48
For runtime dependencies we have a much stricter license check. Combining the license check code with that for regular tools makes it harder to follow.
2023-10-09Remove no longer used dependency from the list of allowed dependenciesbjorn3-1/+0
2023-10-07allow option-ext as a tool dependency (MPL licensed)Ralf Jung-0/+1
2023-10-06Make `tidy-alphabetical-{start,end}` work more widely.Nicholas Nethercote-2/+2
Don't restrict it to lines that have `//` in them. This means it can be used in `Cargo.toml` files, for example.
2023-09-27Update cargoWeihang Lo-2/+2
New license exceptions from gix: * (byteyarn", "Apache-2.0") * ("encoding_rs", "(Apache-2.0 OR MIT) AND BSD-3-Clause")
2023-09-24tidy: remove io-lifetimes from the dependency listchenx97-1/+0
2023-09-22Fixes from PRAyush Singh-0/+1
- Hide Docs - Use repr_unpacked error Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-22Add Minimal Std implementation for UEFIAyush Singh-0/+3
Implemented modules: 1. alloc 2. os_str 3. env 4. math Tracking Issue: https://github.com/rust-lang/rust/issues/100499 API Change Proposal: https://github.com/rust-lang/libs-team/issues/87 This was originally part of https://github.com/rust-lang/rust/pull/100316. Since that PR was becoming too unwieldy and cluttered, and with suggestion from @dvdhrm, I have extracted a minimal std implementation to this PR. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-19chore(Cargo.lock): bump colored and tracing-treeMartin Kröning-1/+1
This reduces the amount of dependencies pulling in atty. ``` Updating colored v2.0.0 -> v2.0.4 Updating tracing-tree v0.2.3 -> v0.2.4 ``` Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2023-09-18get rid of duplicate primitive_docsRalf Jung-19/+0
2023-09-15rustdoc: merge theme css into rustdoc.cssMichael Howell-0/+101
Based on https://github.com/rust-lang/rust/pull/115812#issuecomment-1717960119 Having them in separate files used to make more sense, before the migration to CSS variables made the theme files as small as they are nowadays. This is already how docs.rs and mdBook do it.
2023-08-28Move testsCaio-1/+1
2023-08-27also ignore doctestsRalf Jung-1/+2
2023-08-27tell people what to do when removing an error codeRalf Jung-1/+5
2023-08-24Move issue 29181, 2804, 17431, 66768Olanti-2/+2
2023-08-14Upgrade Object and related depsdirreke-0/+2
2023-08-11Auto merge of #113432 - klensy:ms-cut-backtrace, r=ChrisDentonbors-1/+1
reduce deps for windows-msvc targets for backtrace (eventually) mirrors https://github.com/rust-lang/backtrace-rs/pull/543 Some dependencies of backtrace don't used on windows-msvc targets, so exclude them: miniz_oxide (+ adler) addr2line (+ gimli) object (+ memchr) This saves about 30kb of std.dll + 17.5mb of rlibs
2023-08-10Auto merge of #112482 - tgross35:ci-non-rust-linters, r=pietroalbinibors-3/+629
Add support for tidy linting via external tools for non-rust files This change adds the flag `--check-extras` to `tidy`. It accepts a comma separated list of any of the options: * py (test everything applicable for python files) * py:lint (lint python files using `ruff`) * py:fmt (check formatting for python files using `black`) * shell or shell:lint (lint shell files using `shellcheck`) Specific files to check can also be specified via positional args. Examples: * `./x test tidy --check-extras=shell,py` * `./x test tidy --check-extras=py:fmt -- src/bootstrap/bootstrap.py` * `./x test tidy --check-extras=shell -- src/ci/*.sh` * Python formatting can be applied with bless: `./x test tidy --ckeck-extras=py:fmt --bless` `ruff` and `black` need to be installed via pip; this tool manages these within a virtual environment at `build/venv`. `shellcheck` needs to be installed on the system already. --- This PR doesn't fix any of the errors that show up (I will likely go through those at some point) and it doesn't enforce anything new in CI. Relevant zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Other.20linters.20in.20CI
2023-08-05Auto merge of #114143 - Enselic:rename-issue-100605, r=eholkbors-1/+1
Rename tests/ui/issues/issue-100605.rs to ../type/option-ref-advice.rs The test is a regression test for a [bug ](https://github.com/rust-lang/rust/issues/100605) where the compiler gave bad advice for an `Option<&String>`. Rename the file appropriately. Part of #73494
2023-08-05Rename tests/ui/issues/issue-100605.rs to ../type/option-ref-advice.rsMartin Nordholts-1/+1
The test is a regression test for a bug where the compiler gave bad advice for an `Option<&String>`. Rename the file appropriately.
2023-08-05Print tidy command with bless tidy check failureyukang-1/+1