about summary refs log tree commit diff
path: root/src/bootstrap/format.rs
AgeCommit message (Collapse)AuthorLines
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
2019-12-22Remove most files from format ignore listMark Rousskov-20/+23
Also moves formatting to use edition 2018, and to be done in parallel. This brings near-linear speed ups (at least with a small amount of cores).
2019-12-22Do not run if rustfmt.toml does not existMark Rousskov-2/+7
distcheck (and generally publishing tarballs) will not package rustfmt.toml and we for now still support running tidy etc in those tarballs.
2019-12-21Implement rustfmt running manually using ignore crateMark Rousskov-15/+46
This replaces cargo-fmt with rustfmt with --skip-children which should allow us to format code without running into rust-lang/rustfmt#3930. This also bumps up the version of rustfmt used to a more recent one.
2019-12-21Implement `./x.py fmt [--check]`.Adam Perry-0/+28