mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 18:41:05 -05:00
style(cli): Adjust macro/comment style
This commit is contained in:
parent
59c4713e8b
commit
62f10571f3
1 changed files with 22 additions and 22 deletions
|
@ -46,51 +46,51 @@ impl Default for Format {
|
||||||
)]
|
)]
|
||||||
#[command(group = clap::ArgGroup::new("mode").multiple(false))]
|
#[command(group = clap::ArgGroup::new("mode").multiple(false))]
|
||||||
pub(crate) struct Args {
|
pub(crate) struct Args {
|
||||||
#[arg(default_value = ".")]
|
|
||||||
/// Paths to check with `-` for stdin
|
/// Paths to check with `-` for stdin
|
||||||
|
#[arg(default_value = ".")]
|
||||||
pub(crate) path: Vec<std::path::PathBuf>,
|
pub(crate) path: Vec<std::path::PathBuf>,
|
||||||
|
|
||||||
#[arg(short = 'c', long = "config")]
|
|
||||||
/// Custom config file
|
/// Custom config file
|
||||||
|
#[arg(short = 'c', long = "config")]
|
||||||
pub(crate) custom_config: Option<std::path::PathBuf>,
|
pub(crate) custom_config: Option<std::path::PathBuf>,
|
||||||
|
|
||||||
#[arg(long)]
|
|
||||||
/// Ignore implicit configuration files.
|
/// Ignore implicit configuration files.
|
||||||
|
#[arg(long)]
|
||||||
pub(crate) isolated: bool,
|
pub(crate) isolated: bool,
|
||||||
|
|
||||||
#[arg(long, group = "mode")]
|
|
||||||
/// Print a diff of what would change
|
/// Print a diff of what would change
|
||||||
|
#[arg(long, group = "mode")]
|
||||||
pub(crate) diff: bool,
|
pub(crate) diff: bool,
|
||||||
|
|
||||||
#[arg(long, short = 'w', group = "mode")]
|
|
||||||
/// Write fixes out
|
/// Write fixes out
|
||||||
|
#[arg(long, short = 'w', group = "mode")]
|
||||||
pub(crate) write_changes: bool,
|
pub(crate) write_changes: bool,
|
||||||
|
|
||||||
#[arg(long, group = "mode")]
|
|
||||||
/// Debug: Print each file that would be spellchecked.
|
/// Debug: Print each file that would be spellchecked.
|
||||||
|
#[arg(long, group = "mode")]
|
||||||
pub(crate) files: bool,
|
pub(crate) files: bool,
|
||||||
|
|
||||||
#[arg(long, group = "mode")]
|
|
||||||
/// Debug: Print each identifier that would be spellchecked.
|
/// Debug: Print each identifier that would be spellchecked.
|
||||||
|
#[arg(long, group = "mode")]
|
||||||
pub(crate) identifiers: bool,
|
pub(crate) identifiers: bool,
|
||||||
|
|
||||||
#[arg(long, group = "mode")]
|
|
||||||
/// Debug: Print each word that would be spellchecked.
|
/// Debug: Print each word that would be spellchecked.
|
||||||
|
#[arg(long, group = "mode")]
|
||||||
pub(crate) words: bool,
|
pub(crate) words: bool,
|
||||||
|
|
||||||
#[arg(long, group = "mode")]
|
|
||||||
/// Write the current configuration to file with `-` for stdout
|
/// Write the current configuration to file with `-` for stdout
|
||||||
|
#[arg(long, group = "mode")]
|
||||||
pub(crate) dump_config: Option<std::path::PathBuf>,
|
pub(crate) dump_config: Option<std::path::PathBuf>,
|
||||||
|
|
||||||
#[arg(long, group = "mode")]
|
|
||||||
/// Show all supported file types.
|
/// Show all supported file types.
|
||||||
|
#[arg(long, group = "mode")]
|
||||||
pub(crate) type_list: bool,
|
pub(crate) type_list: bool,
|
||||||
|
|
||||||
#[arg(long, value_enum, ignore_case = true, default_value("long"))]
|
#[arg(long, value_enum, ignore_case = true, default_value("long"))]
|
||||||
pub(crate) format: Format,
|
pub(crate) format: Format,
|
||||||
|
|
||||||
#[arg(short = 'j', long = "threads", default_value = "0")]
|
|
||||||
/// The approximate number of threads to use.
|
/// The approximate number of threads to use.
|
||||||
|
#[arg(short = 'j', long = "threads", default_value = "0")]
|
||||||
pub(crate) threads: usize,
|
pub(crate) threads: usize,
|
||||||
|
|
||||||
#[command(flatten)]
|
#[command(flatten)]
|
||||||
|
@ -106,28 +106,28 @@ pub(crate) struct Args {
|
||||||
#[derive(Debug, Clone, clap::Args)]
|
#[derive(Debug, Clone, clap::Args)]
|
||||||
#[command(rename_all = "kebab-case")]
|
#[command(rename_all = "kebab-case")]
|
||||||
pub(crate) struct FileArgs {
|
pub(crate) struct FileArgs {
|
||||||
#[arg(long, overrides_with("no_binary"))]
|
|
||||||
/// Search binary files.
|
/// Search binary files.
|
||||||
|
#[arg(long, overrides_with("no_binary"))]
|
||||||
binary: bool,
|
binary: bool,
|
||||||
#[arg(long, overrides_with("binary"), hide = true)]
|
#[arg(long, overrides_with("binary"), hide = true)]
|
||||||
no_binary: bool,
|
no_binary: bool,
|
||||||
|
|
||||||
#[arg(long, overrides_with("check_filenames"))]
|
|
||||||
/// Skip verifying spelling in file names.
|
/// Skip verifying spelling in file names.
|
||||||
|
#[arg(long, overrides_with("check_filenames"))]
|
||||||
no_check_filenames: bool,
|
no_check_filenames: bool,
|
||||||
#[arg(long, overrides_with("no_check_filenames"), hide = true)]
|
#[arg(long, overrides_with("no_check_filenames"), hide = true)]
|
||||||
check_filenames: bool,
|
check_filenames: bool,
|
||||||
|
|
||||||
#[arg(long, overrides_with("check_files"))]
|
|
||||||
/// Skip verifying spelling in files.
|
/// Skip verifying spelling in files.
|
||||||
|
#[arg(long, overrides_with("check_files"))]
|
||||||
no_check_files: bool,
|
no_check_files: bool,
|
||||||
#[arg(long, overrides_with("no_check_files"), hide = true)]
|
#[arg(long, overrides_with("no_check_files"), hide = true)]
|
||||||
check_files: bool,
|
check_files: bool,
|
||||||
|
|
||||||
#[arg(long, overrides_with("no_unicode"), hide = true)]
|
#[arg(long, overrides_with("no_unicode"), hide = true)]
|
||||||
unicode: bool,
|
unicode: bool,
|
||||||
#[arg(long, overrides_with("unicode"))]
|
|
||||||
/// Only allow ASCII characters in identifiers
|
/// Only allow ASCII characters in identifiers
|
||||||
|
#[arg(long, overrides_with("unicode"))]
|
||||||
no_unicode: bool,
|
no_unicode: bool,
|
||||||
|
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
|
@ -194,42 +194,42 @@ impl ConfigArgs {
|
||||||
#[derive(Debug, clap::Args)]
|
#[derive(Debug, clap::Args)]
|
||||||
#[clap(rename_all = "kebab-case")]
|
#[clap(rename_all = "kebab-case")]
|
||||||
pub(crate) struct WalkArgs {
|
pub(crate) struct WalkArgs {
|
||||||
#[clap(long, name = "GLOB")]
|
|
||||||
/// Ignore files & directories matching the glob.
|
/// Ignore files & directories matching the glob.
|
||||||
|
#[clap(long, name = "GLOB")]
|
||||||
exclude: Vec<String>,
|
exclude: Vec<String>,
|
||||||
|
|
||||||
#[clap(long, overrides_with("no_hidden"))]
|
|
||||||
/// Search hidden files and directories.
|
/// Search hidden files and directories.
|
||||||
|
#[clap(long, overrides_with("no_hidden"))]
|
||||||
hidden: bool,
|
hidden: bool,
|
||||||
#[clap(long, overrides_with("hidden"), hide = true)]
|
#[clap(long, overrides_with("hidden"), hide = true)]
|
||||||
no_hidden: bool,
|
no_hidden: bool,
|
||||||
|
|
||||||
#[clap(long, overrides_with("ignore"))]
|
|
||||||
/// Don't respect ignore files.
|
/// Don't respect ignore files.
|
||||||
|
#[clap(long, overrides_with("ignore"))]
|
||||||
no_ignore: bool,
|
no_ignore: bool,
|
||||||
#[clap(long, overrides_with("no_ignore"), hide = true)]
|
#[clap(long, overrides_with("no_ignore"), hide = true)]
|
||||||
ignore: bool,
|
ignore: bool,
|
||||||
|
|
||||||
#[clap(long, overrides_with("ignore_dot"))]
|
|
||||||
/// Don't respect .ignore files.
|
/// Don't respect .ignore files.
|
||||||
|
#[clap(long, overrides_with("ignore_dot"))]
|
||||||
no_ignore_dot: bool,
|
no_ignore_dot: bool,
|
||||||
#[clap(long, overrides_with("no_ignore_dot"), hide = true)]
|
#[clap(long, overrides_with("no_ignore_dot"), hide = true)]
|
||||||
ignore_dot: bool,
|
ignore_dot: bool,
|
||||||
|
|
||||||
#[clap(long, overrides_with("ignore_global"))]
|
|
||||||
/// Don't respect global ignore files.
|
/// Don't respect global ignore files.
|
||||||
|
#[clap(long, overrides_with("ignore_global"))]
|
||||||
no_ignore_global: bool,
|
no_ignore_global: bool,
|
||||||
#[clap(long, overrides_with("no_ignore_global"), hide = true)]
|
#[clap(long, overrides_with("no_ignore_global"), hide = true)]
|
||||||
ignore_global: bool,
|
ignore_global: bool,
|
||||||
|
|
||||||
#[clap(long, overrides_with("ignore_parent"))]
|
|
||||||
/// Don't respect ignore files in parent directories.
|
/// Don't respect ignore files in parent directories.
|
||||||
|
#[clap(long, overrides_with("ignore_parent"))]
|
||||||
no_ignore_parent: bool,
|
no_ignore_parent: bool,
|
||||||
#[clap(long, overrides_with("no_ignore_parent"), hide = true)]
|
#[clap(long, overrides_with("no_ignore_parent"), hide = true)]
|
||||||
ignore_parent: bool,
|
ignore_parent: bool,
|
||||||
|
|
||||||
#[clap(long, overrides_with("ignore_vcs"))]
|
|
||||||
/// Don't respect ignore files in vcs directories.
|
/// Don't respect ignore files in vcs directories.
|
||||||
|
#[clap(long, overrides_with("ignore_vcs"))]
|
||||||
no_ignore_vcs: bool,
|
no_ignore_vcs: bool,
|
||||||
#[clap(long, overrides_with("no_ignore_vcs"), hide = true)]
|
#[clap(long, overrides_with("no_ignore_vcs"), hide = true)]
|
||||||
ignore_vcs: bool,
|
ignore_vcs: bool,
|
||||||
|
|
Loading…
Reference in a new issue