-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Format placeholder code when generating a crate #7827
Merged
bors
merged 12 commits into
rust-lang:master
from
Kinrany:7656-format-placeholder-code-when-generating-a-crate
Feb 5, 2020
Merged
Format placeholder code when generating a crate #7827
bors
merged 12 commits into
rust-lang:master
from
Kinrany:7656-format-placeholder-code-when-generating-a-crate
Feb 5, 2020
Commits on Jan 21, 2020
-
Today I learned that `rustfmt` is now a part of `rustup`. So I need to actually look it up in PATH instead of using `cargo-fmt`. I also learned that `mk` is the file that does the main work and is shared by `cargo-new` and `cargo-init`, as expected. Printing inside `mk` produces output as expected.
Configuration menu - View commit details
-
Copy full SHA for 6057c93 - Browse repository at this point
Copy the full SHA 6057c93View commit details
Commits on Jan 25, 2020
-
Log entry 2: first implementation
I think I found the correct place in the algorithm where rustfmt should be called. I'm not sure if using `std::process::Command` and converting errors into warnings is the correct way here. Also the warning should only be printed once. Unless `config.shell().warn()` deduplicates warnings, right now there will be one warning per source file. So I should probably check that `rustfmt` exists only once and disable formatting if it doesn't.
Configuration menu - View commit details
-
Copy full SHA for aa7fe99 - Browse repository at this point
Copy the full SHA aa7fe99View commit details -
Configuration menu - View commit details
-
Copy full SHA for f8edf75 - Browse repository at this point
Copy the full SHA f8edf75View commit details
Commits on Jan 26, 2020
-
Deduplicate warnings about missing rustfmt
There's now exactly one warning per new crate instead of one per source file. Also warnings are being logged now, not printed to console.
Configuration menu - View commit details
-
Copy full SHA for 63cb62d - Browse repository at this point
Copy the full SHA 63cb62dView commit details
Commits on Jan 27, 2020
-
Test 1: init a library crate with a `rustfmt.toml` config file in it. Expect the generated source files to be formatted according to the config file. Test 2: same as test 1, but with missing `rustfmt`. Expect `cargo init` to ignore the absence of `rustfmt` and generate source files with default formatting.
Configuration menu - View commit details
-
Copy full SHA for 6baf6bc - Browse repository at this point
Copy the full SHA 6baf6bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ab0be0 - Browse repository at this point
Copy the full SHA 5ab0be0View commit details -
The tests were failing with error: "could not determine the current user, please set $USER"
Configuration menu - View commit details
-
Copy full SHA for ea4f53c - Browse repository at this point
Copy the full SHA ea4f53cView commit details
Commits on Jan 30, 2020
-
Log rustfmt output if it fails; also do not check that rustfmt exists
Worst case is that the logs will have multiple errors caused by missing rustfmt, so checking separately that rustfmt exists is unnecessary.
Configuration menu - View commit details
-
Copy full SHA for 768b60a - Browse repository at this point
Copy the full SHA 768b60aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1695b89 - Browse repository at this point
Copy the full SHA 1695b89View commit details
Commits on Feb 4, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a70ac57 - Browse repository at this point
Copy the full SHA a70ac57View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68a1c78 - Browse repository at this point
Copy the full SHA 68a1c78View commit details
Commits on Feb 5, 2020
-
Do not run
formats_source
ifrustfmt
is not availableGeneralized `clippy_is_available` and renamed as `command_is_available`. No checks in `ignores_failure_to_format_source`, it's not supposed to use `rustfmt` even if it's available
Configuration menu - View commit details
-
Copy full SHA for bc4c65c - Browse repository at this point
Copy the full SHA bc4c65cView commit details
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.