58 Commits

Author SHA1 Message Date
Ed Page
2c5b4dfca9 fix(future): Report all content as a single Report 2025-09-11 17:15:42 -05:00
Ed Page
8e1cdcfb55 fix(future): Remove gap between item and its children 2025-09-11 17:15:42 -05:00
Ed Page
54ce51c343 fix(future): Lead with non-capital letter
Per rustc dev guide
2025-09-11 17:15:42 -05:00
Ed Page
155255fe41 fix(future): Lead with the suggested action 2025-09-11 17:15:42 -05:00
Ed Page
95aa52c177 fix(future): Indent potential candidates
This better matches other sub-lists
2025-09-11 17:15:42 -05:00
Ed Page
1b9265ca73 fix(future): Remove leading newline to match note conventions 2025-09-11 17:15:42 -05:00
Ed Page
8682394e7b fix(future): Be consistent in suggestion spacing 2025-09-11 17:15:42 -05:00
Ed Page
322b82a2e0 test(future): Serialize output to avoid unordered
Parallel isn't part of this test and it makes snapshot updating
annoying.
2025-09-11 17:15:42 -05:00
Scott Schafer
022dc5b381
chore: Address most typos 2025-09-02 18:15:50 -06:00
Eric Huss
1ce8023626 Rustfmt 2024 2025-07-05 19:50:36 -07:00
Ross Sullivan
92d9a94d02
chore: Migrated testsuite to testsuite::prelude 2025-06-25 22:37:24 +09:00
Eric Huss
0b2299e889 Remove an excess newline
The udpate_message already has a newline when it is there. When it is an
empty string, it ends up adding an unnecessary blank line.
2025-03-21 16:32:28 -07:00
Eric Huss
b17b9a4b90 Elaborate the full output when there are newer versions available
This output was never tested.
2025-03-21 16:32:28 -07:00
Eric Huss
4d961ed19c Don't show a suggestion to update dependencies
This removes the suggestion to update dependencies when the future
incompat error comes from the local crate. It doesn't make sense to
suggest that.
2025-03-21 16:32:28 -07:00
Eric Huss
497cfe5e48 Remove excess trailing space 2025-03-21 16:32:28 -07:00
Eric Huss
3fb97ecf28 Fix off-by-one error when future-incompat report is cached
This fixes a problem introduced by
https://github.com/rust-lang/cargo/pull/11648 where the future-incompat
report will tell you to run with an `--id` flag with the wrong value
if the report is already cached.

The solution is to add a method to determine which ID to use for the
suggestions *before* attempting to save the report.
2025-03-21 16:32:26 -07:00
Eric Huss
afdfd9263e Add some more explicit future-incompat tests
This updates some tests to include the full output for both a local
crate and a dependency.
2025-03-21 16:26:45 -07:00
Eric Huss
941c414a90 Add test for cached report id 2025-03-21 16:04:43 -07:00
Ed Page
55350fc670 test: Switch from 'exec_with_output' to 'run'
This is a follow up to #14846 which changed `run` to return the
`RawOutput`.

Reasons I didn't "update" some code to the new `run` return value
- We were actually using `ProcessBuilder::exec_with_output` and I didn't
  want to disentangle what it would take to switch to `Execs`
- We did processing on the `Result` and I didn't want to check how that
  could be updated
2024-11-21 13:48:27 -06:00
Ed Page
f80fc018a6 test: Ensure we don't rely on unit return values
This will allow changing `Execs::run` return type
2024-11-18 20:52:53 -06:00
Ed Page
af3cfd5abe fix(test): Un-deprecate contains assertions 2024-11-07 15:55:35 -06:00
Ed Page
a6cf1be655 test: Switch from allow to expect deprecated
This caught a couple of lingering items.
2024-09-23 20:44:06 -05:00
Ed Page
5b9799c6f4 refactor: Migrate from extern crate to test-support prelude
We now include the prelude in so many places, this simplifies how we can
present how `cargo-test-support` works.

Yes, this included some `use` clean ups but its already painful enough
walking through every test file, I didn't want to do it twice.
2024-07-12 15:57:00 -05:00
eth3lbert
ef27c273af
test: migrate future_incompat_report to snapbox 2024-07-02 08:42:34 +08:00
Ed Page
dc5ac62cab fix(test): Deprecate non-snapbox assertions
While this is noisy and hides other deprecations, I figured deprecations would
make it easier for people to discover what tasks remain and allow us to
divide and conquer this work rather than doing a heroic PR.
In theory, this will be short lived and we'll go back to seeing
deprecations in our tests.
2024-06-10 10:20:52 -05:00
Eric Huss
52d2303dd0 Update future-incompat output test for latest nightly. 2024-02-15 09:36:40 -08:00
Ed Page
4bf1af0cd0 fix(update): Make -p more convenient by being positional
Generally, cargo avoids positional arguments.  Mostly for the commands
that might forward arguments to another command, like `cargo test`.
It also allows some flexibility in turning flags into options.

For `cargo add` and `cargo remove`, we decided to accept positionals
because the motivations didn't seem to apply as much (similar to `cargo
install`).

This applies the pattern to `cargo update` as well which is in the same
category of commands as `cargo add` and `cargo remove`.

As for `--help` formatting, I'm mixed on whether `[SPEC]...` should be at the top like
other positionals or should be relegated to "Package selection".  I went
with the latter mostly to make it easier to visualize the less common
choice.

Switching to a positional for `cargo update` (while keeping `-p` for
backwards compatibility) was referenced in #12425.
2023-08-23 11:57:36 -05:00
Weihang Lo
b567a67d5c
test: bypass rustc --test impl details for -Zfuture-incompat-test
Switch to an empty `lib.rs` from `main.rs`.

See https://github.com/rust-lang/rust/issues/114804#issuecomment-1677233355
2023-08-14 13:40:47 +01:00
Scott Schafer
4934dffa5a chore: update future_incompat_report tests to use check 2023-02-20 12:21:27 -06:00
Eric Huss
1c3640e05c Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
Scott Schafer
c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
Scott Schafer
4bc8fe85bd remove unneeded nightly flags from various tests 2022-07-14 19:55:44 -05:00
cuishuang
6f13c466d2 fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-05-08 01:07:28 +08:00
Ed Page
cdec3838a8 Extend pkgid syntax with @ support
In addition to `foo:1.2.3`, we now support `foo@1.2.3` for pkgids.  We
are also making it the default way of rendering pkgid's for the user.

With cargo-add in #10472, we've decided to only use `@` in it and to add
it as an alternative to `:` in the rest of cargo.  `cargo-add`
originally used `@`.  When preparing it for merge, I switched to `:` to
be consistent with pkgids. When discussing this, it was felt `@` has
precedence in too many tools to switch to `:` but that we should instead
switch pkgid's to use `@`, in a backwards compatible way.

See also https://internals.rust-lang.org/t/feedback-on-cargo-add-before-its-merged/16024/26?u=epage
2022-04-19 16:00:15 -05:00
Aaron Hill
997bf3fffc
Stabilize future-incompat-report
Depends on https://github.com/rust-lang/rust/pull/91535
2021-12-05 14:14:32 -05:00
Aaron Hill
5c3b38086f
Adjust comments 2021-10-18 12:06:23 -05:00
Aaron Hill
958f2fc962
Display more information in report 2021-10-18 12:01:07 -05:00
Aaron Hill
6f18507092
Display update message in report 2021-10-12 17:02:13 -05:00
Aaron Hill
49ae189b3b
Combined newer versions into single list 2021-10-12 16:35:01 -05:00
Aaron Hill
ce259228cd
Change package spec 2021-10-12 16:35:01 -05:00
Aaron Hill
20340e1e79
Rename arg and adjust tests 2021-10-12 16:35:01 -05:00
Aaron Hill
d5538c3869
Make future-incompat-report output more user-friendly
When the user enables `--future-incompat-report`, we now display
a high-level summary of the problem, as well as several suggestions
for fixing the affected crates.

The command `cargo report future-incompatibilities` now takes
a `--crate` option, which can be used to display a report
(including the actual lint messages) for a single crate.
When this option is not used, we display the report for all
crates.
2021-10-12 16:35:01 -05:00
Aaron Hill
88679e07f2
Implement [future-incompat-report] config section
Currently, I've just implemented the `always` and `never` frequencies
from the RFC, which don't require tracking any additional state.
2021-08-19 15:59:36 -05:00
Eric Huss
f00a85a871 Re-enable future-incompatible tests. 2021-07-16 05:45:29 -07:00
Eric Huss
e7df0d136c Temporarily disable future_incompat tests. 2021-06-29 11:56:03 -07:00
Eric Huss
afe7314ede Don't trigger an update when looking for suggestions. 2021-06-21 09:55:29 -07:00
Eric Huss
a93bfcbdff Print reports using shell to handle old Windows colors properly. 2021-06-21 09:50:42 -07:00
Eric Huss
71cb59b6ef Future-incompat report: Add suggestions of newer versions. 2021-06-21 09:49:43 -07:00
Eric Huss
1f7141f892 Add future-incompat as an alias for future-incompatibilities. 2021-06-21 09:49:43 -07:00
Eric Huss
c2b02b3926 Updates to future-incompatible reporting. 2021-06-21 09:49:41 -07:00