about summary refs log tree commit diff
path: root/src/bootstrap/format.rs
AgeCommit message (Collapse)AuthorLines
2023-10-17move bootstrap core implementation to bootstrap/src/core moduleonur-ozkan-322/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-09-01bootstrap/format: remove unnecessary paths.pushRalf Jung-4/+0
2023-08-02fmt_override is a better name since we are also adding files to whitelistyukang-23/+23
2023-08-02print more detailed format files and untracked files countyukang-2/+19
2023-07-30bootstrap: inline format!() argsMatthias Krüger-4/+4
2023-07-15Rollup merge of #113644 - jyn514:bootstrap-cleanups, r=albertlarsan68Matthias Krüger-2/+2
misc bootstrap cleanups - rename `detail_exit_macro` to `exit` - remove unnecessary `Builder::new_standalone` function - support `x suggest` with build-metrics
2023-07-13Rename `detail_exit_macro` to `exit`jyn-2/+2
`detail` and `macro` weren't adding any info.
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-2/+6
2023-05-30create `build_helper/src/util` modozkanonur-2/+2
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-22stop `x fmt` formatting alt build dirsEzra Shaw-4/+2
2023-03-09Rollup merge of #108778 - jyn514:quiet-fmt, r=albertlarsan68Matthias Krüger-1/+7
x fmt: Don't print all modified files if there's more than 10 This avoids spam for dozens of modified files. Fixes https://github.com/rust-lang/rust/issues/106920.
2023-03-09Don't print all modified files if there's more than 10Joshua Nelson-1/+7
This avoids spam for dozens of modified files.
2023-03-05Rollup merge of #108776 - jyn514:quiet-tidy, r=ozkanonurMatthias Krüger-2/+4
Make `x test tidy` less noisy Before: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 0.29s fmt check skip untracked path chrome_profiler.json during rustfmt invocations skip untracked path query_impl-default,args.mm_profdata during rustfmt invocations skip untracked path query_impl-llvm.txt during rustfmt invocations skip untracked path query_impl-mono_items.txt during rustfmt invocations skip untracked path query_impl-summarize.txt during rustfmt invocations skip untracked path rustc.svg during rustfmt invocations skip untracked path rustc_middle.mono_items.json during rustfmt invocations skip untracked path rustc_middle.mono_items.md during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_attr.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_macro.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items.md during rustfmt invocations tidy check Found 505 error codes Highest error code: `E0793` * 397 features Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:54 ``` After: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 2.24s fmt check tidy check Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:04 ```
2023-03-05Make `x test tidy` less noisyJoshua Nelson-2/+4
Before: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 0.29s fmt check skip untracked path chrome_profiler.json during rustfmt invocations skip untracked path query_impl-default,args.mm_profdata during rustfmt invocations skip untracked path query_impl-llvm.txt during rustfmt invocations skip untracked path query_impl-mono_items.txt during rustfmt invocations skip untracked path query_impl-summarize.txt during rustfmt invocations skip untracked path rustc.svg during rustfmt invocations skip untracked path rustc_middle.mono_items.json during rustfmt invocations skip untracked path rustc_middle.mono_items.md during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_attr.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_macro.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items.md during rustfmt invocations tidy check Found 505 error codes Highest error code: `E0793` * 397 features Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:54 ``` After: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 2.24s fmt check tidy check Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:04 ```
2023-03-05x fmt: Only check modified files locallyJoshua Nelson-1/+5
Previously, `x fmt` would only format modified files, while `x fmt .` and `x fmt --check` would still look at all files. After this change, `x fmt --check` only looks at modified files locally. I feel pretty confident in this change - other than https://github.com/rust-lang/rust/issues/106261, no one has reported bugs in `get_modified_rs_files` since it was added in https://github.com/rust-lang/rust/pull/105702.
2023-02-27Rollup merge of #108308 - bjorn3:faster_bootstrap_build, r=albertlarsan68Matthias Krüger-1/+1
Allow building serde and serde_derive in parallel This reduces build time of bootstrap by ~6s
2023-02-27Allow building serde and serde_derive in parallelbjorn3-1/+1
This reduces build time of bootstrap by ~6s
2023-02-23support `x fmt` for sub and outside of rust directoriesozkanonur-2/+2
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-02-14Allow shortcuts to directories to be used for `./x.py fmt`许杰友 Jieyou Xu (Joe)-2/+38
Fixes #107944. Maximum recursive search depth is 3 and only accepts shortcuts for directories (single component paths, such as `./x.py fmt std`). If there are no shortcut candidates but single componenet path(s) are given, it falls back to the previous behavior to panic with unable to find directory. If there are multiple shortcut candidates for a given single component path, the shortcut candidates are considered ambiguous, are then ignored, and the single component path is accepted as-is. After this change, `./x.py fmt std` no longer panics and formats `library/std` instead.
2023-02-10cleanup and fix namingyukang-1/+1
2023-02-10add only modified for compiletestyukang-16/+4
2023-01-06Handle non-existant upstream master branches in `x fmt`Nilstrieb-17/+35
2023-01-03Add `build_helper` crate to share code between tidy and bootstrapNilstrieb-29/+1
2022-12-30Dont use `--merge-base` during bootstrap formatting subcommandMichael Goulet-14/+9
2022-12-30fix #106261, formater should not try to format non-Rust filesyukang-3/+4
2022-12-27Put final touchesAlbert Larsan-40/+34
2022-12-27Add rustfmt version checkAlbert Larsan-15/+70
2022-12-27Format only modified filesAlbert Larsan-0/+46
As discussed on #105688, this makes x fmt only format modified files
2022-12-17poll rustfmt child processesThe 8472-4/+19
2022-11-12Distinguish `--dry-run` from the automatic dry run checkJoshua Nelson-1/+1
2022-07-11Auto merge of #98526 - jyn514:download-llvm-outside-checkout, r=Mark-Simulacrumbors-5/+4
Allow using `download-ci-llvm = true` outside the git checkout `@bjorn3` noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled: ``` $ ./rust2/x.py build fatal: not a git repository (or any of the parent directories): .git thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version" expected success, got: exit status: 128', src/bootstrap/native.rs:134:20 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Support it too for consistency. It's unclear to me when anyone would need to use this, but `@bjorn3` feels we should support it, and it's not much additional effort to get it working.
2022-07-10Allow using `download-ci-llvm = true` outside the git checkoutJoshua Nelson-5/+4
@bjorn3 noticed that this is already allowed today when download-llvm is disabled, but breaks with it enabled: ``` $ ./rust2/x.py build fatal: not a git repository (or any of the parent directories): .git thread 'main' panicked at 'command did not execute successfully: "git" "rev-list" "--author=bors@rust-lang.org" "-n1" "--first-parent" "HEAD" "--" "/home/jnelson/rust-lang/rust2/src/llvm-project" "/home/jnelson/rust-lang/rust2/src/bootstrap/download-ci-llvm-stamp" "/home/jnelson/rust-lang/rust2/src/version" expected success, got: exit status: 128', src/bootstrap/native.rs:134:20 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Support it too for consistency. It's unclear to me when anyone would need to use this, but @bjorn3 feels we should support it, and it's not much additional effort to get it working. This also updates a bunch of other git commands that were similarly depending on the current directory.
2022-07-07squash the commitstoshiki goto-2/+2
implement detail_exit but I'm not sure it is right. not create new file and write detail exit in lib.rs replace std::process::exit to detail_exit that is not related to code runnning. remove pub
2022-06-07Move beta rustfmt downloads to rustbuildJoshua Nelson-11/+7
2022-05-25feat: refactored bootstrap files to use stderr consistentlyRaiyan-3/+3
2022-03-05Merge build_helper into utilbjorn3-1/+1
2022-03-05Remove build_helperbjorn3-1/+1
The majority of the code is only used by either rustbuild or rustc_llvm's build script. Rust_build is compiled once for rustbuild and once for every stage. This means that the majority of the code in this crate is needlessly compiled multiple times. By moving only the code actually used by the respective crates to rustbuild and rustc_llvm's build script, this needless duplicate compilation is avoided.
2022-03-04Fix a bug in `x.py fmt` that prevents some files being formatted.Nicholas Nethercote-1/+6
If you have a file in the repository root with the same name as a file somewhere within a directory, the latter currently won't get formatted. I have experienced this multiple times and not understood what was happening; I finally figured out the problem today. This commit fixes the problem.
2022-02-22Use 2021 edition in ./x.py fmtbjorn3-1/+1
2021-05-01Allow formatting specific subdirectoriesJoshua Nelson-3/+14
2021-02-20remove redundant box wrapperThe8472-4/+4
2021-02-20limit rustfmt parallelism by taking -j into accountThe8472-3/+3
2021-02-20parallelize x.py test tidyThe8472-19/+64
old: ``` real 0m11.123s user 0m14.495s sys 0m5.227s ``` new: ``` real 0m2.767s user 0m13.014s sys 0m1.691s ```
2020-09-16Remove unnecessary `clone()`s in bootstrapJoshua Nelson-5/+3
The performance difference is negligible, but it makes me feel better. Note that this does not remove some clones in `config`, because it would require changing the logic around (and performance doesn't matter for bootstrap).
2020-08-22bootstrap: fix a couple of clippy lint warningsMatthias Krüger-1/+1
clippy::print_literal clippy::clone_on_copy clippy::single_char_pattern clippy::into_iter_on_ref clippy::match_like_matches_macro
2020-05-17bootstrap: fix typoRalf Jung-1/+1
2020-03-21Validate git setup before accessing functionalityDillon Amburgey-11/+43
2020-03-18Tidy: fix running rustfmt twiceEric Huss-0/+3
2020-02-27Ignore untracked paths when running `rustfmt` on repository.Felix S. Klock II-1/+12
2020-01-14Tweak assertion note in fmtYuki Okushi-1/+9