Skip to content

Commit 6abe29b

Browse files
authored
format: update to use tab spaces = 2 (#157)
spaces 2
1 parent da03038 commit 6abe29b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3547
-3529
lines changed

rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ chain_width = 70
66
match_arm_leading_pipes = "Never"
77
# https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#merge_derives
88
merge_derives = true
9+
tab_spaces = 2

src/common/cli.rs

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,78 +3,78 @@ use clap::Parser;
33
use std::fmt;
44

55
impl fmt::Display for JsExtension {
6-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7-
let extension = match self {
8-
JsExtension::Ts => ".ts".to_string(),
9-
JsExtension::Js => ".js".to_string(),
10-
};
11-
write!(f, "{}", extension)
12-
}
6+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7+
let extension = match self {
8+
JsExtension::Ts => ".ts".to_string(),
9+
JsExtension::Js => ".js".to_string(),
10+
};
11+
write!(f, "{}", extension)
12+
}
1313
}
1414

1515
#[derive(Parser, Debug, Clone)]
1616
#[clap(author, version, about)]
1717
pub struct Cli {
18-
/// Path to the Typescript or Javascript project
19-
#[clap(parse(from_os_str))]
20-
pub path: std::path::PathBuf,
18+
/// Path to the Typescript or Javascript project
19+
#[clap(parse(from_os_str))]
20+
pub path: std::path::PathBuf,
2121

22-
/// Javascript Extension
23-
#[clap(
22+
/// Javascript Extension
23+
#[clap(
2424
value_enum,
2525
long,
2626
default_value_t=JsExtension::Ts
2727
)]
28-
pub ext: JsExtension,
28+
pub ext: JsExtension,
2929

30-
/// Type of primary database to connect
31-
#[clap(value_enum, long)]
32-
pub db_type: Option<DatabaseType>,
30+
/// Type of primary database to connect
31+
#[clap(value_enum, long)]
32+
pub db_type: Option<DatabaseType>,
3333

34-
/// Primary DB host
35-
#[clap(long)]
36-
pub db_host: Option<String>,
34+
/// Primary DB host
35+
#[clap(long)]
36+
pub db_host: Option<String>,
3737

38-
/// Primary DB Port
39-
#[clap(long)]
40-
pub db_port: Option<u16>,
38+
/// Primary DB Port
39+
#[clap(long)]
40+
pub db_port: Option<u16>,
4141

42-
/// Primary DB user
43-
#[clap(long)]
44-
pub db_user: Option<String>,
42+
/// Primary DB user
43+
#[clap(long)]
44+
pub db_user: Option<String>,
4545

46-
/// Primary DB pass
47-
#[clap(long)]
48-
pub db_pass: Option<String>,
46+
/// Primary DB pass
47+
#[clap(long)]
48+
pub db_pass: Option<String>,
4949

50-
/// Primary DB database name
51-
#[clap(long)]
52-
pub db_name: Option<String>,
50+
/// Primary DB database name
51+
#[clap(long)]
52+
pub db_name: Option<String>,
5353

54-
/// PostgreSQL schema search path (default is "$user,public") https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH
55-
#[clap(long)]
56-
pub pg_search_path: Option<String>,
54+
/// PostgreSQL schema search path (default is "$user,public") https://www.postgresql.org/docs/current/ddl-schemas.html#DDL-SCHEMAS-PATH
55+
#[clap(long)]
56+
pub pg_search_path: Option<String>,
5757

58-
/// Folder paths to ignore
59-
#[clap(long, multiple_values = true)]
60-
pub ignore: Vec<String>,
58+
/// Folder paths to ignore
59+
#[clap(long, multiple_values = true)]
60+
pub ignore: Vec<String>,
6161

62-
/// Path to the file based configuration
63-
#[clap(long, parse(from_os_str))]
64-
pub config: Option<std::path::PathBuf>,
62+
/// Path to the file based configuration
63+
#[clap(long, parse(from_os_str))]
64+
pub config: Option<std::path::PathBuf>,
6565

66-
/// generate types of raw SQLs using default configuration
67-
#[clap(long, short)]
68-
pub generate_types: bool,
66+
/// generate types of raw SQLs using default configuration
67+
#[clap(long, short)]
68+
pub generate_types: bool,
6969

70-
/// generates types in a target directory path or a file
71-
#[clap(long, parse(from_os_str))]
72-
pub generate_path: Option<std::path::PathBuf>,
70+
/// generates types in a target directory path or a file
71+
#[clap(long, parse(from_os_str))]
72+
pub generate_path: Option<std::path::PathBuf>,
7373

74-
#[clap(long, short)]
75-
pub message_format: Option<String>,
74+
#[clap(long, short)]
75+
pub message_format: Option<String>,
7676

77-
/// log level to be used for the CLI info > warn > error
78-
#[clap(value_enum, long)]
79-
pub log_level: Option<LogLevel>,
77+
/// log level to be used for the CLI info > warn > error
78+
#[clap(value_enum, long)]
79+
pub log_level: Option<LogLevel>,
8080
}

0 commit comments

Comments
 (0)