Skip to content

Commit

Permalink
fix: github actions detection not working properly
Browse files Browse the repository at this point in the history
  • Loading branch information
tomocrafter authored and benfdking committed Dec 1, 2024
1 parent 492769c commit a5c0d94
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions crates/cli/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::path::PathBuf;
use std::{
fmt::{write, Display},
path::PathBuf,
};

use clap::{Parser, Subcommand, ValueEnum};

Expand Down Expand Up @@ -30,7 +33,7 @@ pub(crate) enum Commands {
pub(crate) struct LintArgs {
/// Files or directories to fix. Use `-` to read from stdin.
pub paths: Vec<PathBuf>,
#[arg(default_value = "human", short, long)]
#[arg(default_value_t, short, long)]
pub format: Format,
}

Expand All @@ -41,7 +44,7 @@ pub(crate) struct FixArgs {
/// Skip the confirmation prompt and go straight to applying fixes.
#[arg(long)]
pub force: bool,
#[arg(default_value = "human", short, long)]
#[arg(default_value_t, short, long)]
pub format: Format,
}

Expand All @@ -60,3 +63,12 @@ impl Default for Format {
}
}
}

impl Display for Format {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Format::Human => f.write_str("human"),
Format::GithubAnnotationNative => f.write_str("github-annotation-native"),
}
}
}

0 comments on commit a5c0d94

Please sign in to comment.