1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/// `swayfmt` file name.
pub const SWAY_FORMAT_FILE_NAME: &str = "swayfmt.toml";
//FUNDAMENTALS
/// Default max width of each line.
pub const DEFAULT_MAX_LINE_WIDTH: usize = 100;
/// Default tab size as spaces.
pub const DEFAULT_TAB_SPACES: usize = 4;
//HEURISTICS
/// Default max width of the args of a function call before falling back to vertical formatting.
pub const DEFAULT_FN_CALL_WIDTH: usize = 60;
/// Default max width of the args of a function-like attributes before falling back to vertical formatting.
pub const DEFAULT_ATTR_FN_LIKE_WIDTH: usize = 70;
/// Default max width in the body of a user-defined structure literal before falling back to vertical formatting.
pub const DEFAULT_STRUCTURE_LIT_WIDTH: usize = 18;
/// Default max width of a user-defined structure field before falling back to vertical formatting.
pub const DEFAULT_STRUCTURE_VAR_WIDTH: usize = 35;
/// Default Maximum width of an array literal before falling back to vertical formatting.
pub const DEFAULT_COLLECTION_WIDTH: usize = 80;
/// Default width threshold for an array element to be considered short.
pub const DEFAULT_SHORT_ARRAY_ELEM_WIDTH_THRESHOLD: usize = 10;
/// Default max length of a chain to fit on a single line.
pub const DEFAULT_CHAIN_WIDTH: usize = 60;
/// Default max line length for single line if-else expression.
pub const DEFAULT_SINGLE_LINE_IF_ELSE_WIDTH: usize = 50;
//ITEMS
/// Default max number of blank lines which can be put between items.
pub const DEFAULT_BLANK_LINES_UPPER_BOUND: usize = 1;
/// Default min number of blank lines which must be put between items.
pub const DEFAULT_BLANK_LINES_LOWER_BOUND: usize = 0;
/// Write an items and its attribute on the same line if their combined width is below a threshold.
pub const DEFAULT_INLINE_ATTR_WIDTH: usize = 0;
//COMMENTS
/// Default max length of comments.
pub const DEFAULT_MAX_COMMENT_WIDTH: usize = 80;
//NEWLINE_STYLE
pub const LINE_FEED: char = '\n';
pub const CARRIAGE_RETURN: char = '\r';
pub const WINDOWS_NEWLINE: &str = "\r\n";
pub const UNIX_NEWLINE: &str = "\n";
pub const NEW_LINE: &str = WINDOWS_NEWLINE;
pub const NEW_LINE: &str = UNIX_NEWLINE;
//INDENT_STYLE
// INDENT_BUFFER.len() = 81
pub const INDENT_BUFFER_LEN: usize = 80;
pub const INDENT_BUFFER: &str =
"\n ";
// 8096 is close enough to infinite according to `rustfmt`.
pub const INFINITE_SHAPE_WIDTH: usize = 8096;
pub const HARD_TAB: char = '\t';
/// Default max number of newlines allowed in between statements before collapsing them to
/// threshold
pub const DEFAULT_NEWLINE_THRESHOLD: usize = 1;
//IDENT
pub const RAW_MODIFIER: &str = "r#";