Commit graph

38 commits

Author SHA1 Message Date
Ed Page c6c1df4758 chore: Make N-2 the default MSRV
We likely don't want to release these packages every 6 months just for
an MSRV bump.
By moving the MSRV out of the package, `cargo bump-check` will ignore
the MSRV bump.

Inspired by #13266
2024-01-18 15:30:41 -06:00
renovate[bot] 03beda3a6e chore(deps): update msrv 2024-01-08 22:17:07 +00:00
Eric Huss e7eaa51909 cargo fix: Call rustc fewer times.
This changes `cargo fix` so that it keeps track of the output so that it
doesn't need to run the final "show the output" step.
2024-01-02 15:03:06 -08:00
renovate[bot] 4deb34bd0b
chore(deps): update compatible 2024-01-02 10:21:24 +00:00
Eric Huss 3d3e1b3668 Handle Windows newlines.
Suggestions that come from rustc that are multi-line only use LF line
endings. But if the file is checked out on windows with CRLF
line-endings, then you end up with a mix of line endings that don't
match the "fixed.rs" file.

Tracking this at https://github.com/rust-lang/rust/issues/119482.
2023-12-31 16:20:41 -08:00
Eric Huss a21997f0cc rustfix: Support inserting new lines.
If rustfix received a suggestion which inserts new lines without
replacing existing lines, it would ignore the suggestion. This is
because `parse_snippet` would immediately return if the `lines` to
replace was empty.

The solution here is to just drop the code which messes with the
original text line. `cargo fix` (and compiletest) currently do not use
this. This was originally added back in the days when rustfix supported
an interactive UI which showed color highlighting of what it looks like
with the replacement. My feeling is that when we add something like this
back in, I would prefer to instead use a real diff library and display
instead of trying to do various text manipulation for display. This
particular code has generally been buggy, and has been a problem several
times.

The included test fails without this fix because the changes do not
apply, and the code cannot compile.
2023-12-31 10:18:22 -08:00
Eric Huss 029fe2bafc Add a primitive way to add new tests to parse_and_replace.
This adds an environment variable to make it easier to add new tests.
2023-12-31 09:58:37 -08:00
Eric Huss c54fa88ea4 Cleanup rustfix parse_and_replace test.
This is just some minor code cleanup for the parse_and_replace test,
there should not be any functional differences.
2023-12-31 09:56:20 -08:00
Weihang Lo ad2c45bde9
refactor: clean up package metadata
Like PR 12352 but for homepage and repository

Versions for

* `cargo-credential-1password`
* `cargo-util-schemas`
* `home`

are bumped along with the change.
2023-12-18 16:09:03 -05:00
bors 9c1316ff3f Auto merge of #13181 - hi-rustin:rustin-patch-rename-files, r=weihanglo
chore(rustfix): rename Readme.md to README.md
2023-12-18 15:04:01 +00:00
hi-rustin 0b6c229e9d chore(rustfix): remove useless clippy rules
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-18 20:17:05 +08:00
hi-rustin b8e2f75881 chore(rustfix): fix a typo
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-18 20:10:28 +08:00
hi-rustin efdaf4bbc6 chore(rustfix): rename Changelog.md to CHANGELOG.md
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-18 20:05:52 +08:00
hi-rustin 88993a3bbe chore(rustfix): rename Readme.md to README.md
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-18 20:04:50 +08:00
renovate[bot] ab6adab01b
chore(deps): update compatible 2023-12-01 17:33:18 +00:00
Weihang Lo 21274da65b
chore: bump rustfix to 0.7.0 2023-11-27 10:50:10 -05:00
Weihang Lo ed347ce4dc
refactor: use custom error instead of anyhow 2023-11-27 10:50:10 -05:00
bors 3920bd5ea5 Auto merge of #13047 - tompscanlan:rustfix-ignored-tests, r=weihanglo
review and remove ignored tests in rustfix

### What does this PR try to resolve?
review ignored tests in rustfix crate per #13034.

### How should we test and review this PR?
CI testing

### Additional information

* Removed unproductive test in `parse_and_replace`
* un-ignore proptests, and reduce runtime from ~2s to ~<.25s
2023-11-26 17:14:11 +00:00
Tom Scanlan b179cd175a
review and remove ignored tests in rustfix
* reduce time in proptest
* delete edition dir
* remove refs to fixmode::EDITION
2023-11-26 09:29:18 -05:00
bors 35ed69cb1b Auto merge of #13048 - weihanglo:rustfix-doc, r=epage
docs: add doc comments for rustfix
2023-11-25 23:45:45 +00:00
Weihang Lo 358b7ae76d
docs(rustfix): add more doc comments 2023-11-25 17:48:21 -05:00
Weihang Lo 27b7c6c203
docs(rustfix): comments for diagnostic JSON output
Most doc comments are copied from rust-lang/rust repo.

The doc for each item is hand-written as there is no comment in the
original place.
2023-11-25 13:09:39 -05:00
Tom Scanlan e9e22e5c2f try running on windows 2023-11-23 18:34:56 -05:00
Eric Huss 47c7ff0f96 Deduplicate the similar dependency. 2023-11-21 10:18:15 -08:00
Eric Huss 70f56e9004 Add a general introduction to the rustfix library docs. 2023-11-21 10:10:22 -08:00
Eric Huss f99a494c31 Remove copyright headers in tests.
These were all removed a while ago in https://github.com/rust-lang/rust/pull/57108
2023-11-19 08:20:21 -08:00
Eric Huss b5308f648b Fix tests to run on stable. 2023-11-19 08:17:17 -08:00
Eric Huss d6e49ca06b Fix clippy warnings. 2023-11-19 08:07:37 -08:00
Eric Huss b8ba6cd333 Bump the rustfix version. 2023-11-18 18:46:34 -08:00
Eric Huss 6e798b39bd Update rustfix readme to be a little more current. 2023-11-18 18:44:40 -08:00
Eric Huss a4fd77ce35 Switch rustfix license files to be symlinks 2023-11-18 18:31:08 -08:00
Eric Huss 63830afede Remove some unused rustfix files. 2023-11-18 18:29:58 -08:00
Eric Huss 3c0126aec4 rustfix: Drop test dependency on duct
It didn't seem to be doing anything that `Command` doesn't already
support. This helps lighten the dependency size.
2023-11-18 18:21:01 -08:00
Eric Huss f25cc63617 Update rustfix to use a newer proptest.
This uses the same version used elsewhere in cargo.
2023-11-18 18:14:00 -08:00
Eric Huss d0d9bd5cbb Switch rustfix to using tracing instead of log.
This helps bring it in line with the rust of cargo.
2023-11-18 18:10:44 -08:00
Eric Huss 9cb59bc202 Idiom lints are now configured in the manifest. 2023-11-18 17:49:18 -08:00
Eric Huss 3ca00ad8cd Integrate rustfix's manifest into the workspace. 2023-11-18 17:40:20 -08:00
Eric Huss 73e5506338 Merge remote-tracking branch 'rustfix/master' into rustfix 2023-11-18 16:51:22 -08:00