chore: Update from _rust/main template

This commit is contained in:
Ed Page
2025-06-02 14:46:22 -05:00
13 changed files with 64 additions and 32 deletions

2
.cargo/config.toml Normal file
View File

@@ -0,0 +1,2 @@
[resolver]
incompatible-rust-versions = "fallback"

View File

@@ -9,15 +9,15 @@
customManagers: [
{
customType: 'regex',
fileMatch: [
'^rust-toolchain\\.toml$',
'Cargo.toml$',
'clippy.toml$',
'^Makefile$',
'^tests/derive_ui.rs$',
'\\.clippy.toml$',
'^\\.github/workflows/ci.yml$',
'^\\.github/workflows/rust-next.yml$',
managerFilePatterns: [
'/^rust-toolchain\\.toml$/',
'/Cargo.toml$/',
'/clippy.toml$/',
'/^Makefile$/',
'/^tests/derive_ui.rs$/',
'/\\.clippy.toml$/',
'/^\\.github/workflows/ci.yml$/',
'/^\\.github/workflows/rust-next.yml$/',
],
matchStrings: [
'STABLE.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',

View File

@@ -3,29 +3,22 @@ exclude: |
tests/.*|
CHANGELOG.md
)$
default_install_hook_types: ["pre-commit", "commit-msg"]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-yaml
stages: [commit]
- id: check-json
stages: [commit]
- id: check-toml
stages: [commit]
- id: check-merge-conflict
stages: [commit]
- id: check-case-conflict
stages: [commit]
- id: detect-private-key
stages: [commit]
- repo: https://github.com/crate-ci/typos
rev: v1.16.20
rev: v1.32.0
hooks:
- id: typos
stages: [commit]
- repo: https://github.com/crate-ci/committed
rev: v1.0.20
rev: v1.1.7
hooks:
- id: committed
stages: [commit-msg]

View File

@@ -21,12 +21,12 @@ include = [
"Cargo.toml",
"LICENSE*",
"README.md",
"benches/**/*",
"examples/**/*"
]
[workspace.lints.rust]
rust_2018_idioms = { level = "warn", priority = -1 }
unnameable_types = "allow"
unreachable_pub = "warn"
unsafe_op_in_unsafe_fn = "warn"
unused_lifetimes = "warn"
@@ -69,7 +69,7 @@ lossy_float_literal = "warn"
macro_use_imports = "warn"
mem_forget = "warn"
mutex_integer = "warn"
needless_continue = "warn"
needless_continue = "allow"
needless_for_each = "warn"
negative_feature_names = "warn"
path_buf_push_overwrite = "warn"
@@ -78,6 +78,7 @@ rc_mutex = "warn"
redundant_feature_names = "warn"
ref_option_ref = "warn"
rest_pat_in_fully_bound_structs = "warn"
result_large_err = "allow"
same_functions_in_if_condition = "warn"
self_named_module_files = "warn"
semicolon_if_nothing_returned = "warn"
@@ -97,6 +98,15 @@ multiple_bound_locations = "allow"
assigning_clones = "allow"
blocks_in_conditions = "allow"
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
codegen-units = 1
lto = true
# debug = "line-tables-only" # requires Cargo 1.71
[package]
name = "clap"
version = "4.5.39"

View File

@@ -10,15 +10,16 @@ Builder implementation for clap.
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual-licensed as above, without any additional terms or
conditions.
See [CONTRIBUTING](CONTRIBUTING.md) for more details.

View File

@@ -47,3 +47,7 @@ mod util;
const INTERNAL_ERROR_MSG: &str = "Fatal internal error. Please consider filing a bug \
report at https://github.com/clap-rs/clap/issues";
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDoctests;

View File

@@ -106,3 +106,7 @@ pub use aot::generate_to;
pub use aot::Generator;
/// Deprecated, see [`aot::Shell`]
pub use aot::Shell;
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDoctests;

View File

@@ -235,3 +235,7 @@ fn generate_completion(completions: &mut String, cmd: &Command, is_subcommand: b
fn single_line_styled_str(text: &StyledStr) -> String {
text.to_string().replace('\n', " ")
}
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDoctests;

View File

@@ -10,15 +10,16 @@ Macro implementation for clap's derives.
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual-licensed as above, without any additional terms or
conditions.
See [CONTRIBUTING](CONTRIBUTING.md) for more details.

View File

@@ -520,3 +520,7 @@ fn is_number(arg: &str) -> bool {
None => true,
}
}
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDoctests;

View File

@@ -347,3 +347,7 @@ fn app_has_arguments(cmd: &clap::Command) -> bool {
fn app_has_subcommands(cmd: &clap::Command) -> bool {
cmd.get_subcommands().any(|i| !i.is_hide_set())
}
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDoctests;

View File

@@ -87,6 +87,7 @@ allow = [
"MIT",
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"MPL-2.0",
"Unicode-DFS-2016",

View File

@@ -100,3 +100,7 @@ pub mod _faq;
pub mod _features;
#[cfg(feature = "unstable-doc")]
pub mod _tutorial;
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDoctests;