150 Commits

Author SHA1 Message Date
Weihang Lo
22f2745066
fix(config): combine key error context into one 2025-09-24 12:24:07 -04:00
Ed Page
2e231072f4 test(manifest): Fix test output order
As this is an unordered test, sometimes snapshot updating can mess up
the line order.
2025-09-08 21:04:05 -05:00
Scott Schafer
d36c326926
chore(deps): update rust crate annotate-snippets to 0.12.1 2025-09-02 15:43:38 -06:00
Samuel Onoja
5dd597b621
impl workspace hint for boolean dependencies
hint for only bad dependency true literal and rename unit test to match
2025-08-19 18:15:32 +01:00
Samuel Onoja
7e78c54630
initial test commit 2025-08-19 18:15:32 +01:00
Ed Page
539a48452a perf: Update toml 2025-07-08 11:55:41 -05:00
Eric Huss
1ce8023626 Rustfmt 2024 2025-07-05 19:50:36 -07:00
Marijn Schouten
6eb5adcc50 bad_config: replace cargo build with cargo check 2025-07-01 19:55:58 +00:00
Marijn Schouten
e2987afda7 move config tests from build.rs to bad_config.rs 2025-07-01 18:58:41 +00:00
Marijn Schouten
87a24aa734 better msg for bug #15703 2025-07-01 18:53:33 +00:00
Marijn Schouten
56602aacd1 fix bug #15703 2025-07-01 08:06:47 +00:00
Marijn Schouten
01850417d7 add test for bug #15703 2025-07-01 07:35:27 +00:00
Ross Sullivan
92d9a94d02
chore: Migrated testsuite to testsuite::prelude 2025-06-25 22:37:24 +09:00
Naman Garg
a9d5cb8abe
Add MultipleScript (error on stable, error about not implemented on nightly) 2025-06-23 19:14:37 +05:30
Ed Page
6ec8da96f4 fix(schema): Mark package.name as optional 2025-02-10 14:29:15 -06:00
Ed Page
5f529f792d test(toml): Verify missing package.name 2025-02-06 14:54:30 -06:00
Ed Page
f6514977ef
feat: add cargo pkgid support for cargo-script (#14961)
### What does this PR try to resolve?

close https://github.com/rust-lang/cargo/issues/14831

In this PR, we added the `cargo pkgid` support for the cargo-script.

For the package itself:

```console
cargo pkgid --manifest-path foo.rs
path+file:///my-project/foo.rs/foo#0.86.0
```

For its dependence:

```console
cargo pkgid --manifest-path foo.rs -p sqlx
registry+https://github.com/rust-lang/crates.io-index#sqlx@0.7.4
```

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

I have updated the unit tests and also added more test cases for it.

### Additional information

None
2025-02-04 19:52:07 +00:00
Rustin170506
d4c1eeeaa0 refactor: use manifest path as the key
Signed-off-by: Rustin170506 <techregister@pm.me>

fix
2025-01-20 21:53:13 +08:00
许杰友 Jieyou Xu (Joe)
17aaafd92f tests: relax bad_crate_type to only match error message prefix
So that the cargo test isn't sensitive to suggestions for known crate
types that a rustc PR <https://github.com/rust-lang/rust/pull/134720> is
trying to add.
2024-12-30 04:22:28 +08:00
Ed Page
81411ec545 feat: Stabilize Edition 2024 2024-11-25 09:27:09 -06:00
Ed Page
d2ec764995 fix(resolve): Dont show locking workspace members
This is for `cargo generate-lockfile` and when syncing the lockfile with
the manifest.
We still show it for `cargo update` because of `cargo update
--workspace`.

We hacked around this previously by filtering out the `num_pkgs==1` case
for single packages but this didn't help with workspaces.
2024-08-22 16:57:06 -05:00
Joe Birr-Pixton
b9fe71853e Correct diagnostic for TomlDebugInfo
This is missing the friendly aliases introduced in 3dbb474c.
2024-08-16 16:48:03 +01:00
Scott Schafer
eff4b74da3
test: Resolve bad_config deprecations 2024-06-12 13:31:55 -06: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
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
fe0819ee9e fix(toml): Validate crates_types/proc-macro for bin like others
Turns out, we allow these fields, just in limited ways, so we need to be
consistent.

I limited when this applies to reduce noise from the user solving there
problem because they are unlikely to keep the field and switch it to the
opposite value
2024-05-01 19:36:30 -05:00
Ed Page
2c31fe33e8 test(toml): Show underscore behavior for bin targets 2024-05-01 19:35:53 -05:00
Ed Page
d59e7a3443 test(toml): Scope proc_macro2 tests to libs 2024-05-01 19:32:13 -05:00
Ed Page
aecb40baac fix(toml): Remove underscore field support in 2024
This is part of the 2024 Edition and is part of rust-lang/rust#123754 and #13629
2024-04-25 11:56:32 -05:00
bors
955503e1de Auto merge of #13800 - epage:u3, r=weihanglo
fix(toml): Don't double-warn when underscore is used in workspace dep

### What does this PR try to resolve?

This is prep for removing them in the 2024 Edition and is part of rust-lang/rust#123754 and #13629

Particularly, I wanted to make sure I didn't make things worse and in doing so found there was room for improvement.

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

### Additional information
2024-04-24 20:25:10 +00:00
Ed Page
751fd47d34 fix(toml): Don't double-warn when underscore is used in workspace dep 2024-04-24 14:22:23 -05:00
Ed Page
4cc82833bd test(toml): Show default_features warning for workspace dependencies 2024-04-24 13:51:31 -05:00
Ed Page
034ef3c27b fix(toml): Be more forceful with underscore/dash redundancy
During #13783, I had considered making the 2024 edition behavior a
"unused key" warning.  However, I'm being too lazy in piping the data
through correctly (and a hard error might be better to help users
transition).
2024-04-22 12:47:43 -05:00
Ed Page
d1f02476c2 fix(toml): Deprecate underscore fields 2024-04-18 16:15:34 -05:00
Ed Page
868662c480 test(toml): Show underscore field behavior 2024-04-18 14:57:12 -05:00
Ed Page
208d10d06d fix(toml): Switch the duplicate table warning to an unused key warning 2024-04-18 14:49:50 -05:00
Ed Page
265f93e913 test(toml): Be consistent on expected output formatting 2024-04-18 14:45:27 -05:00
Ed Page
d210644a1b test(toml): Switch from build to check for these bad_config 2024-04-18 14:40:04 -05:00
Ed Page
8520ec63b6 test(toml): Centralize underscore field tests 2024-04-18 14:38:05 -05:00
Ed Page
cf23e4b538 fix(toml)!: Disallow source-less dependencies
This is part of #13629

This turns deps like
```toml
foo = { optional = true }
```
from `version="*"` deps with a warning into errors.
This breaking change was deemed acceptable because this behavior has
been considered a bug from the beginning.
We have gotten little to no feedback about people wanting this behavior.

This improves our forwards-compatibility story as we can add new
dependency sources and they won't be considered a wildcard registry
dependency on older cargo.
2024-04-18 12:55:27 -05:00
Ed Page
14646e6af6 test: Make edition explicit on packages 2024-02-22 11:37:03 -06:00
Ed Page
e7e8d8748a fix(compiler): Clarify we're showing a profile name 2024-02-08 14:01:39 -06:00
Ed Page
db54c040ae fix(new): Print a 'Creating', rather than 'Created' status
This has bothered me about `cargo new` and `cargo init` for a while that
the output is read backwards, for example:
```diff
--- i/tests/testsuite/cargo_init/path_contains_separator/stderr.log
+++ w/tests/testsuite/cargo_init/path_contains_separator/stderr.log
@@ -1,3 +1,3 @@
+    Creating binary (application) package
 warning: the path `[ROOT]/case/test:ing/.` contains invalid PATH characters (usually `:`, `;`, or `"`)
 It is recommended to use a different name to avoid problems.
-     Created binary (application) package
```
2024-01-29 15:29:10 -06:00
Ed Page
675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
Scott Schafer
0d62ae2fc3
feat: Add rustc style errors for manifest parsing 2023-12-15 13:30:10 -07:00
renovate[bot]
b4efcdbf32 chore(deps): update rust crate gix to 0.55.2 2023-11-01 00:12:37 +00:00
Weihang Lo
08c5e35f60
test(trim-paths): parsing in mainfest and config 2023-10-30 16:38:55 -04:00
David Tolnay
3871aecf3e
Improve deserialization errors of untagged enums 2023-08-27 16:27:08 -07:00
David Tolnay
58d042516e
Fill in more configuration deserialization and manifest deserialization tests 2023-08-27 16:14:29 -07:00
Ed Page
53dcd2f454 fix(manifest): Provide more context on sematic errors 2023-08-24 16:27:53 -05:00