Skip to content

Commit

Permalink
Merge pull request #4198 from weiznich/fix/tidy
Browse files Browse the repository at this point in the history
Fix the tidy command
  • Loading branch information
weiznich authored Aug 24, 2024
2 parents 2457243 + d636e34 commit 2307f29
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
5 changes: 3 additions & 2 deletions diesel/src/pg/expression/helper_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ pub type array_append<A, E> = super::functions::array_append<SqlTypeOf<A>, SqlTy
/// Return type of [`array_replace(array, element, replace_with)`](super::functions::array_replace())
#[allow(non_camel_case_types)]
#[cfg(feature = "postgres_backend")]
pub type array_replace<A, E, R> = super::functions::array_replace<SqlTypeOf<A>, SqlTypeOf<E>, A, E, R>;
pub type array_replace<A, E, R> =
super::functions::array_replace<SqlTypeOf<A>, SqlTypeOf<E>, A, E, R>;

/// Return type of [`array_dims(array)`](super::functions::array_append())
#[allow(non_camel_case_types)]
Expand All @@ -376,4 +377,4 @@ pub type array_prepend<E, A> = super::functions::array_prepend<SqlTypeOf<E>, Sql
/// Return type of [`array_remove(array, element)`](super::functions::array_remove())
#[allow(non_camel_case_types)]
#[cfg(feature = "postgres_backend")]
pub type array_remove<A, E> = super::functions::array_remove<SqlTypeOf<A>, SqlTypeOf<E>, A, E>;
pub type array_remove<A, E> = super::functions::array_remove<SqlTypeOf<A>, SqlTypeOf<E>, A, E>;
20 changes: 6 additions & 14 deletions diesel_cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,23 +210,15 @@ pub fn build_cli() -> Command {
.alias("db")
.arg(migration_dir_arg())
.about("A group of commands for setting up and resetting your database.")
.subcommand(
Command::new("setup")
.arg(no_default_migration_arg())
.about(
"Creates the database specified in your DATABASE_URL, and \
.subcommand(Command::new("setup").arg(no_default_migration_arg()).about(
"Creates the database specified in your DATABASE_URL, and \
then runs any existing migrations.",
)
)
.subcommand(
Command::new("reset")
.arg(no_default_migration_arg())
.about(
"Resets your database by dropping the database specified \
))
.subcommand(Command::new("reset").arg(no_default_migration_arg()).about(
"Resets your database by dropping the database specified \
in your DATABASE_URL and then running `diesel database \
setup`.",
)
)
))
.subcommand(
Command::new("drop")
.about("Drops the database specified in your DATABASE_URL.")
Expand Down
3 changes: 2 additions & 1 deletion diesel_cli/tests/database_setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ fn database_setup_no_default_migrations() {
// sanity check
assert!(!db.exists());

let result = p.command("database")
let result = p
.command("database")
.arg("setup")
.arg("--no-default-migration")
.run();
Expand Down
11 changes: 10 additions & 1 deletion xtask/src/tidy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct TidyArgs {

impl TidyArgs {
pub(crate) fn run(&self) {
let mut success = true;
let metadata = MetadataCommand::default().exec().unwrap();
let mut command = Command::new("cargo");

Expand All @@ -34,6 +35,8 @@ impl TidyArgs {
println!("\t Run `cargo fmt --all` to format the source code");
if !self.keep_going {
std::process::exit(1);
} else {
success = false;
}
}

Expand All @@ -53,6 +56,8 @@ impl TidyArgs {
println!("\t Run `typos -w` to address some of the issues");
if !self.keep_going {
std::process::exit(1);
} else {
success = false;
}
}

Expand All @@ -65,6 +70,10 @@ impl TidyArgs {
.run();

println!();
println!("All checks were successful. Ready to submit the code!");
if success {
println!("All checks were successful. Ready to submit the code!");
} else {
std::process::exit(1);
}
}
}

0 comments on commit 2307f29

Please sign in to comment.