Commit Graph

584 Commits

Author SHA1 Message Date
bors
99361c46e0 Auto merge of #14092 - Alexendoo:rustfix-separate-suggestions, r=weihanglo
Add `CodeFix::apply_solution` and impl `Clone`

### What does this PR try to resolve?

In Clippy we have a good few lints that produce mutually exclusive suggestions e.g.

```
error: octal-looking escape in a literal
  --> tests/ui/octal_escapes.rs:6:19
   |
LL |     let _bad2 = b"\033[0m";
   |                   ^^^^
   |
help: if an octal escape is intended, use a hex escape instead
   |
LL |     let _bad2 = b"\x1b[0m";
   |                   ~~~~
help: if a null escape is intended, disambiguate using
   |
LL |     let _bad2 = b"\x0033[0m";
   |                   ~~~~~~
```

For these we have to disable rustfix tests since the suggestions are overlapping, this PR adds a method to `rustfix` that `ui_test` could use in order to produce multiple `.fixed` files, one for each alternative suggestion

### Additional information

It does not work for for multiple suggestions coming from a single subdiagnostic ([`Diag::span_suggestions`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/diagnostic/struct.Diag.html#method.span_suggestions)) e.g.

```
help: consider importing one of these items
  |
1 + use std::collections::HashMap;
  |
1 + use ahash::HashMap;
```

Solving this would be blocked on https://github.com/rust-lang/rust/issues/53934, on the Clippy side we only have one use of `span_suggestions` however so it's still very useful without this

The test cases use Clippy lints that I generated by setting the `parse_and_replace` test to use `clippy-driver` because of familiarity, if there's a rustc case that does multiple suggestions it would be good to go with that
2024-06-19 20:32:26 +00:00
Alex Macleod
5a15397611 Add CodeFix::apply_solution and impl Clone 2024-06-19 19:06:36 +00:00
Weihang Lo
f4985827d7
chore: bump cargo-test-{support,macro} due to public API changes 2024-06-17 11:37:21 -04:00
Eric Huss
eadde99fe7 Update git2 for libgit2 1.8.1 2024-06-13 17:39:37 -07:00
Ed Page
b07e87656f chore: Bump version for internal crates 2024-06-13 13:38:32 -05:00
Weihang Lo
8eabb38fb8
Bump to 0.82.0 2024-06-10 18:24:27 -04:00
Ed Page
2b7e335946 feat(test): Enable structured data assertions 2024-06-10 10:20:52 -05:00
Ed Page
d028cfaba3 chore(test): Bump cargo-test-support to 0.2.2 2024-06-10 10:20:52 -05:00
bors
d8f9130c62 Auto merge of #14038 - epage:schemas, r=weihanglo
chore: Bump cargo-util-schemas to 0.5

See #13902
2024-06-10 14:57:18 +00:00
Ed Page
786ebe9d14 chore: Bump cargo-util-schemas to 0.5
See #13902
2024-06-10 09:53:58 -05:00
hi-rustin
b8b84ceffd
chore(deps): update rust crate pulldown-cmark to 0.11.0
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-06-10 21:47:13 +08:00
renovate[bot]
eb37755b49
chore(deps): update rust crate itertools to 0.13.0 2024-06-09 18:15:29 +00:00
renovate[bot]
3177fe200d
chore(deps): update compatible 2024-06-09 12:59:53 +00:00
Scott Schafer
7d7b7c2c8b
feat: Add an xtask to generate lint documentation 2024-06-06 23:03:53 -06:00
Ed Page
c00c5cd1cf fix(add): Avoid escaping double-quotes by using string literals
Fixes #14002
2024-06-03 11:22:00 -05:00
Ed Page
995c2b75ee chore: Upgrade to snapbox 0.6.7
This comes with improved redacting on mismatches which will provide
more focused assertions and there will be less need for intervention on
snapshot updates.

This also gives more flexibility with placeholders
2024-05-29 14:07:15 -05:00
WANG Rui
e57b6ab573 Update openssl-src to 111.28.2+1.1.1w 2024-05-29 11:59:16 +08:00
Ed Page
5ea1c8fea9 feat(test): Auto-redact elapsed time 2024-05-27 21:27:25 -05:00
Ed Page
eafc743c0d chore: Update to snapbox 0.6
We needed to tweak the redactions because snapbox no longer normalizes
slashes on redactions unless the data type is a `PathBuf`.
2024-05-27 21:26:20 -05:00
Ed Page
602f2f2e21 chore: Upgrade to snapbox 0.5.14 2024-05-24 14:55:47 -05:00
Ed Page
fc733032b3 chore: Bump cargo-credential 2024-05-24 14:55:42 -05:00
Sebastian Thiel
81a59b01ec
upgrade gix from 0.62 to 0.63
This is a bugfix release with various improvements, some of which relevant
to safety when checking out (possibly freshly cloned) repositories.

See https://github.com/Byron/gitoxide/security/advisories/GHSA-7w47-3wg8-547c
and https://github.com/Byron/gitoxide/security/advisories/GHSA-49jc-r788-3fc9
2024-05-22 15:17:45 +02:00
Weihang Lo
26bcf58bfe
test(rustfix): run some tests only on nightly 2024-05-09 09:30:25 -04:00
renovate[bot]
05ba4d8cfe chore(deps): update msrv (1 version) to v1.78 2024-05-02 15:07:25 +00:00
Thibault Saunier
4634aa6403 cargo-util: Bump version 2024-05-02 10:20:00 -04:00
renovate[bot]
4570c94d54
chore(deps): update compatible 2024-05-01 15:09:07 +00:00
Ed Page
bdd4bda518 fix(toml)!: Remove support for inheriting badges
We allowed `[badges]` to inherit from `[workspace.package.badges]`

This was a bug:
- This was not specified in the RFC
- We did not document this
- Even if someone were to try to guess to use this, it is inconsistent
  with how inheritance works because this should inherit from
  `workspace.badges` instead of `workspace.package.badges`

While keeping in mind that `[badges]` is effectively deprecated.

In that context, I think its safe to break support for this without a
transition period.

Fixes #13643
2024-04-22 14:22:01 -05:00
Weihang Lo
910efc4d23
Bump to 0.81.0 2024-04-28 23:57:55 -04:00
bors
125aa57ad2 Auto merge of #13782 - klensy:llibc, r=weihanglo
gate some libc usages under cfg(unix), drop os_info features

Places few `libc` usages under `cfg(unix)`. That didn't remove it from tree, but still looks cleaner.
Drop features from os_info crate, as serde support currently unused.
2024-04-23 17:32:32 +00:00
klensy
57e820e329 cargo-credential: bump version to 0.4.5
as required by check-version-bump CI
2024-04-20 10:38:49 +03:00
bors
80d5b607dd Auto merge of #13777 - Byron:fix-13773, r=weihanglo
fix 13773 - 'cargo build' fails when list_files() with gix is triggered

Fixes #13773.

### Tasks

* [x] reproduce issue with new test-case
* [x] update [fixed `gix-dir`](https://github.com/rust-lang/cargo/pull/13777) in Cargo.lock to turn test green
2024-04-19 18:39:22 +00:00
klensy
ef39fbf231 os_info: use default-features = false, as no serde support needed 2024-04-19 15:49:19 +03:00
Sebastian Thiel
3fd120b7b3
use the latest patch release of gix-dir to fix #13777 2024-04-19 07:11:43 +02:00
Ed Page
0a5c7d987f fix(toml): Don't crash on parse errors that point to multi-byte character
Fixes #13772
2024-04-18 16:57:22 -05:00
Ed Page
3a2cc82789 test(msrv): Migrate most parse tests to unit tests 2024-04-17 16:47:29 -05:00
renovate[bot]
1a111ab753 chore(deps): update rust crate gix to 0.62.0 [security] 2024-04-15 21:30:05 +00:00
Weihang Lo
1717a35d25
chore: downgrade to openssl v1.1.1 (again)
See rust-lang#13546
2024-04-10 08:44:49 -04:00
renovate[bot]
aedc6c7a5d chore(deps): update rust crate base64 to 0.22.0 2024-04-03 00:25:07 +00:00
renovate[bot]
bfbdfa7a17 chore(deps): update compatible 2024-04-02 15:23:20 -05:00
Maybe Waffle
da291d4f35 Update der crate 2024-04-02 19:34:04 +00:00
bors
c9ca99bd41 Auto merge of #13679 - rust-lang:renovate/opener-0.x, r=epage
chore(deps): update rust crate opener to 0.7.0

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [opener](https://togithub.com/Seeker14491/opener) | workspace.dependencies | minor | `0.6.1` -> `0.7.0` |

---

### Release Notes

<details>
<summary>Seeker14491/opener (opener)</summary>

### [`v0.7.0`](https://togithub.com/Seeker14491/opener/blob/HEAD/CHANGELOG.md#070---2024-03-22)

[Compare Source](https://togithub.com/Seeker14491/opener/compare/v0.6.1...v0.7.0)

##### Added

-   "dbus-vendored" feature, which is enabled by default to match current behavior. This just forwards to the `dbus` crate's "vendored" feature. Disable it to link dynamically to dbus instead of statically.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/rust-lang/cargo).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->
2024-04-01 13:11:52 +00:00
renovate[bot]
dd81de0d1a
chore(deps): update rust crate supports-unicode to v3 2024-04-01 03:40:43 +00:00
renovate[bot]
b66026d656
chore(deps): update rust crate opener to 0.7.0 2024-04-01 03:40:34 +00:00
Paul Mabileau
d691d034c7
Chore(cargo-test-*/Cargo.toml): Bump versions to make ci/validate-version-bump.sh pass
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:14:14 +01:00
Ed Page
451babb370 chore: Bump versions 2024-03-25 14:13:38 -05:00
bors
a5b31ebafa Auto merge of #13592 - Byron:gix-for-list-files-git, r=arlosi
Use `gitoxide` for `list_files_git`

Related to #10150.

### Tasks

* [x] update `gix` to v0.60
* [x] assure this is tested (currently only git-tests run with `git2` and `gitoxide`)
* [x] allow `list_files_git` to use `gitoxide` if it is enabled as feature.
* [x] use dirwalk iterator
* [x] use new release of `gix` with necessary updates

### Review Notes

As this PR has come a long way, I decided to keep a few of the steps leading up to the final state, showing the PR's evolution in the hope it helps the review.

* Would it be better to simply use `gitoxide` for this without a switch? I don't think
  it will cause more trouble than `git2`, and if there is an issue I will fix it with priority.
* In one test, the walk resolves a symlink to a submodule to individual files, including the `.git/*` folder contained in the submodule which is ignored by the walk, i.e. `submodule/*` does not contain it, but `submodule-link/*` does. This is fixed in the gitoxide version, and the `git2` version.
* I noticed that symlinks are resolved for packaging *and* are allowed to point to anywhere, even outside of package root. I left it, but felt that maybe this should be reconsidered.

### Remarks

* I love the test-suite! It's incredibly exhaustive to the point where it uncovers shortcomings in `gitoxide`, which I greatly appreciate.
* I also love `git2` as it's API for many things leads to pretty idiomatic code, and sometimes I really have to work to match it. The example here is the initial `dirwalk()` method which requires a delegate as it doesn't just collect into a `Vec` like `git2` does (for good reason). Turning that into an iterator via `dirwalk_iter()` makes it far more usable, and will definitely be good for performance as the dirwalk work is offloaded into its own thread.
2024-03-24 20:01:45 +00:00
Scott Schafer
307c7f825c
feat: Add a basic linting system 2024-03-23 10:26:02 -06:00
Ed Page
69bbb2c1ae refactor(toml): Push diagnostic complex on annotate-snippets 2024-03-21 15:51:32 -05:00
Scott Schafer
96bbaa11bf
chore: Update annotate-snippets 2024-03-20 10:42:10 -06:00
Sebastian Thiel
9115545053
implement list_files_gix to be used when gitoxide is enabled. 2024-03-18 10:06:13 +01:00