102 Commits

Author SHA1 Message Date
Scott Schafer
66991b5a33
chore: Bump cargo-util-schemas to 0.8.0 2025-04-04 22:44:24 -06:00
Eric Huss
be781458a9 Bump versions due to MSRV update 2025-04-03 07:11:48 -07:00
renovate[bot]
fc88578277
chore(deps): update msrv (1 version) to v1.86 2025-04-03 12:07:38 +00:00
Weihang Lo
4e8014f4be
feat(schemas): add PackageList message schema
This is is for `cargo package --list` in JSON format
2025-03-25 23:02:37 -04:00
Ed Page
b4dee5dcf9 chore: Bump versions 2025-02-20 15:47:07 -06:00
renovate[bot]
c30d4f9293
chore(deps): update msrv (1 version) to v1.85 2025-02-20 19:37:56 +00:00
Ed Page
d5b5074024 refactor(schema): Make TomlPackage defaultable 2025-02-10 14:29:15 -06:00
Ed Page
6ec8da96f4 fix(schema): Mark package.name as optional 2025-02-10 14:29:15 -06:00
renovate[bot]
7ee43a58ec
chore(deps): update msrv (1 version) to v1.84 2025-01-09 19:15:56 +00:00
Ed Page
6fe36c20ad fix(schemas): Make lints.workspace not required 2025-01-08 11:26:39 -06:00
Ed Page
e6114c3395 fix(schema): Include lints sub-tables in packages
This was done by upgrading schemars.  Hard to tell what else was changed
because of the noise from the other changes in the layout.

Fixes #15030
2025-01-08 11:26:39 -06:00
Weihang Lo
4a1e2ea539
fix(schemas): Fix 'metadata' JSON Schema (#15033)
Instead of allowing any type in metadata, we were specifying fields like
`"string": "<any string>"`.

Found this when looking into #15030

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

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

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-01-08 19:05:19 +00:00
Jacob Finkelman
06811d8594 manual impl of hash 2025-01-08 17:35:54 +00:00
Jacob Finkelman
d8b7c072c5 shortening the comment 2025-01-08 17:35:42 +00:00
Ed Page
e48257d3c8 fix(schemas): Fix 'metadata' JSON Schema
Found this when looking into #15030
2025-01-08 11:26:27 -06:00
Ed Page
e8f3e5e0f2 chore(schema): Bump version 2025-01-08 11:26:27 -06:00
Ed Page
729776b589 fix(schema): Correct and update the JSON Schema
Fixes #14999
2025-01-01 10:14:31 -06:00
Ed Page
4e5af28150 refactor(schema): Group TomlManifest fields to clarify requires_package
I found a bug in the manifest parser and figured this would help make it
more obvious.

Since I was already changing the order, I figure I'm make things a
little more logical (user-facing first, implementtion details later)
2024-12-13 10:31:53 -06:00
Ed Page
6da546c9e1 chore: Bump versions 2024-11-29 10:43:19 -06:00
renovate[bot]
1ec49b8947
chore(deps): update msrv 2024-11-29 03:54:45 +00:00
Ed Page
878caf7447 docs: Surround identifiers in backticks
This was mostly done by clippy via `clippy::doc_markdown`.
I then reviewed it to fix words that shouldn't have it or where `--fix`
put the backtick in the wrong location.
2024-11-15 09:33:23 -06:00
Ed Page
13255d0fc1 fix(schemas): Support deserializing str's as well as Strings
Not needed for `toml` but could be useful for other formats.
2024-11-08 10:21:50 -06:00
dacian
21ce69ef37 feat: unstable-json-schema generation for Cargo.toml 2024-10-25 00:05:11 +03:00
renovate[bot]
341d619f66
chore(deps): update msrv 2024-10-19 01:35:59 -04:00
Ed Page
5c87c14f9a docs: Declare support level for each crate in our Charter / docs
This is to bring us into conformance with the [Rust crate ownership
policy](https://forge.rust-lang.org/policies/crate-ownership.html).

Items of note
- `cargo-credential-1password` is declared as Experimental as it is
  intended for the community but I was unsure if we wanted to commit to
  full support for it.  In my mind, the ideal thing to do would be to
  expatriate this to 1password.
- `home` is declared as Internal despite its wide use within the
  ecosystem.
- `cargo-credential` is declared as Intentional as its an API intended
  for the wider ecosystem and I didn't see a reason to declare it
  experimental.
- `cargo-platform`, `cargo-util-schemas`, and `crates-io` are declared
  as Intentional as they are both used internally and intended for
  others to use for logic that integrates with cargo/registries.
  I wondered about these being Experimental or Internal instead.
2024-09-26 12:43:09 -05:00
Ed Page
5e35e271bc feat(toml): Add autolib
PR #5335 added `autobins`, etc for #5330.  Nowhere in there is
discussion of `autolib`.

Cargo script disables support for additional build-targets by disabling
discovery.
Except we don't have a way to disable discovery of `autolib`, leading to #14476.
By adding `autolib`, we can continue in that direction.

This also allows us to bypass inferring of libs on published packages,
like all other build-targets which were handled in #13849.

As this seems fairly low controversy, this insta-stabilizes the field.
In prior versions of Cargo, users will get an "unused manifest key"
warning.
For packags where this is set by `cargo publish`, the warning will be suppressed and things will work as normal.
For `cargo vendor`, the same except there will be some churn in the
vendored source as this field will now be set.
For local development, it should be rare to set `autolib` so the lack of
error by discovering a file when this is set shouldn't be a problem.

Fixes #14476
2024-09-24 11:24:24 -05:00
Ed Page
da18686f29 chore(schemas): Bump version 2024-09-24 11:24:24 -05:00
Ed Page
1b94fb2326 chore: Bump MSRV to 1.81
This is prep for using `#[expect]`.

Its not clear why RenovateBot didn't do this.
2024-09-23 19:45:57 -05:00
Ed Page
f4c7ed1990 fix(pkgid): Allow open namespaces in PackageIdSpec's 2024-08-28 10:35:16 -05:00
Ed Page
c81e82dffb refactor(pkgid): Pull out spec parsing 2024-08-28 10:19:13 -05:00
Ed Page
00604fa152 test(pkgid): Show existing pkgid behavior 2024-08-28 10:03:37 -05:00
Ed Page
8dd37c1d22 refactor(schema): Pull out test helpers for reuse 2024-08-28 10:03:37 -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
Daniel Paoliello
502c74e0a5 Implement base paths (RFC 3529) 1/n: path dep and patch support 2024-08-13 15:00:45 -07:00
Ed Page
d0c54ec87f refactor(toml): Rename 'resolved' to 'normalized'
In a discussion on an issue, it became confusing to talk about
"resolved" manifests and dependency resolution,
so I'm switching manifests to use the other term I considered,
"normalized".
2024-08-01 16:23:53 -05:00
renovate[bot]
74f01c4b65
chore(deps): update msrv 2024-07-26 12:52:37 +00:00
Alex Macleod
9f85086fd2 Add TomlPackage::new, Default for TomlWorkspace 2024-07-19 17:51:38 +00:00
tianyeyouyou
87084c176b remove duplicate words 2024-07-10 20:51:45 +08:00
renovate[bot]
a018e3a946
chore(deps): update msrv (1 version) to v1.79 2024-06-13 17:27:19 +00:00
Ed Page
786ebe9d14 chore: Bump cargo-util-schemas to 0.5
See #13902
2024-06-10 09:53:58 -05:00
bors
54d9c3306b Auto merge of #13902 - heisen-li:plugin, r=weihanglo
fix(toml): remove `lib.plugin` key support and make it warning

### What does this PR try to resolve?

Remove `lib.plugin` key, making it an "unused key" warning.

Remove some of the tests, which should look useless (I hope I'm understanding this

- [x] Remove key, and related tests.
- [x] Adjust the documentation about the plugin.
- [ ] Some of the comments and function names have not yet finished being modified.

part of #13629

Closes #13246
2024-06-09 18:07:55 +00:00
Ed Page
4a6f25c112 refactor: Resolve snapbox deprecations 2024-05-27 10:28:13 -05:00
Urgau
1e4857a4d9 Allow lint config to have extra custom configs
And report the unused manifest key warning for every key that we do not
use, which is currently every of them.
2024-05-16 17:03:42 +02:00
heisen-li
1f48eab757 fix(toml): remove lib.plugin key 2024-05-16 20:03:26 +08:00
renovate[bot]
05ba4d8cfe chore(deps): update msrv (1 version) to v1.78 2024-05-02 15:07:25 +00:00
Ed Page
627b1d1470 feat(fix): Migrate inherited deps with ignored default-features 2024-05-01 12:43:47 -05:00
Ed Page
1e6047763d fix(toml): Warn, rather than fail publish, if build.rs is excluded
This could offer a minor performance gain when reading this manifest
since the target doesn't need to be discovered.
2024-04-29 12:25:19 -05:00
Ed Page
39f1a210b8 perf(toml): Avoid looking up readme on published packages
Not much of a performance gain;
this is mostly done to be consistent with the target work.
2024-04-29 12:25:19 -05: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
Scott Schafer
11d6013c1d
fix(cargo-lints): Respect Forbid lint level 2024-04-20 20:12:47 -06:00