Skip to content

Commit

Permalink
feat: add cargo fmt to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
wzslr321 committed Oct 16, 2024
1 parent e4d1e97 commit ee77e3a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Format check
run: cargo fmt --check
- name: Run tests
run: cargo test --verbose

Expand Down
12 changes: 5 additions & 7 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,11 @@ fn try_retrieve_repo_from_path(path: &Path) -> Result<Repository> {
info!("sucessfully retrieved repository from path");
Ok(repository)
}
Err(err) => {
Err(anyhow!(
"Failed to retrieve repository from path: {:?}.\nError:{}",
path,
err,
))
}
Err(err) => Err(anyhow!(
"Failed to retrieve repository from path: {:?}.\nError:{}",
path,
err,
)),
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ impl Config {
let scripts: Vec<CustomStep> = self
.rules
.iter()
.flat_map(|rule| &rule.transform.steps)
.filter(|step| step.name.starts_with("custom"))
.flat_map(|rule| &rule.transform.steps)
.filter(|step| step.name.starts_with("custom"))
.filter_map(|step| {
step.args
.as_ref()
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
mod cli;
mod config;
mod git;
mod utils;
mod transform;
mod utils;

use cli::CliError;
use anyhow::Result;
use cli::CliError;

fn main() -> Result<(), CliError> {
cli::run()
cli::run()
}

0 comments on commit ee77e3a

Please sign in to comment.