-
Notifications
You must be signed in to change notification settings - Fork 14
/
PyYapf.sublime-settings
167 lines (136 loc) · 6.71 KB
/
PyYapf.sublime-settings
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
{
// full path and command to run yapf
"yapf_command": "",
// reformat entire file if no text is selected
"use_entire_file_if_no_selection": true,
// run yapf before saving document
"on_save": false,
// ignore files matching glob(s)
"onsave_ignore_fn_glob": ["*.pyx"],
// report errors in popup dialog (in addition to status bar)
"popup_errors": false,
// if no encoding is specified use this. utf-8 is a good choice,
// ascii is (much) more restrictive. any of these should work:
// https://docs.python.org/2/library/codecs.html#standard-encodings
"default_encoding": "UTF-8",
// custom yapf style options
//
// if commented out then yapf will search for the formatting style in the following manner:
// 1. in the [style] section of a .style.yapf file in either the current directory or one of its parent directories.
// 2. in the [yapf] section of a setup.cfg file in either the current directory or one of its parent directories.
// 3. in the ~/.config/yapf/style file in your home directory.
// if none of those files are found, the default style is used (PEP8).
//
/*
"config": {
// Determines which of the predefined styles this custom style is based on.
"based_on_style": "pep8",
// Align closing bracket with visual indentation.
"ALIGN_CLOSING_BRACKET_WITH_VISUAL_INDENT": true,
// Insert a blank line before a 'def' or 'class' immediately
// nested within another 'def' or 'class'.
//
// For example:
//
// class Foo:
// # <------ this blank line
// def method():
// ...
//
"BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF": false,
// The column limit.
"COLUMN_LIMIT": 79,
// Indent width for line continuations.
"CONTINUATION_INDENT_WIDTH": 4,
// Put closing brackets on a separate line, dedented, if the
// bracketed expression can't fit in a single line. Applies to
// all kinds of brackets, including function definitions and calls.
//
// For example:
//
// config = {
// 'key1': 'value1',
// 'key2': 'value2',
// } # <--- this bracket is dedented and on a separate line
//
// time_series = self.remote_client.query_entity_counters(
// entity='dev3246.region1',
// key='dns.query_latency_tcp',
// transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
// start_ts=now()-timedelta(days=3),
// end_ts=now(),
// ) # <--- this bracket is dedented and on a separate line
"DEDENT_CLOSING_BRACKETS": false,
// The regex for an i18n comment. The presence of this comment stops
// reformatting of that line, because the comments are required to be
// next to the string they translate.
"I18N_COMMENT": "",
// The i18n function call names. The presence of this function stops
// reformattting on that line, because the string it has cannot be moved
// away from the i18n comment.
"I18N_FUNCTION_CALL": "",
// Indent the dictionary value if it cannot fit on the same line as the dictionary key.
//
// For example:
//
// config = {
// 'key1':
// 'value1',
// 'key2': value1 +
// value2,
// }
"INDENT_DICTIONARY_VALUE": false,
// The number of columns to use for indentation.
"INDENT_WIDTH": 4,
// Join short lines into one line. E.g., single line if statements.
"JOIN_MULTIPLE_LINES": true,
// Insert a space between the ending comma and closing bracket of a list,
// etc.
"SPACE_BETWEEN_ENDING_COMMA_AND_CLOSING_BRACKET": true,
// The number of spaces required before a trailing comment.
"SPACES_BEFORE_COMMENT": 2,
// Set to True to prefer splitting before &, | or ^ rather than after.
"SPLIT_BEFORE_BITWISE_OPERATOR": true,
// Set to True to prefer splitting before 'and' or 'or' rather than
// after.
"SPLIT_BEFORE_LOGICAL_OPERATOR": false,
// Split named assignments onto individual lines.
"SPLIT_BEFORE_NAMED_ASSIGNS": true,
// The penalty for splitting right after the opening bracket.
"SPLIT_PENALTY_AFTER_OPENING_BRACKET": 30,
// The penalty for splitting the line after a unary operator.
"SPLIT_PENALTY_AFTER_UNARY_OPERATOR": 10000,
// The penalty of splitting the line around the &, |, and ^ operators.
"SPLIT_PENALTY_BITWISE_OPERATOR": 300,
// The penalty for characters over the column limit.
"SPLIT_PENALTY_EXCESS_CHARACTER": 2500,
// The penalty incurred by adding a line split to the unwrapped line. The
// more line splits added the higher the penalty.
"SPLIT_PENALTY_FOR_ADDED_LINE_SPLIT": 30,
// The penalty of splitting a list of import as names.
//
// For example:
//
// from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
// long_argument_2,
// long_argument_3)
//
// would reformat to something like:
//
// from a_very_long_or_indented_module_name_yada_yad import (
// long_argument_1, long_argument_2, long_argument_3)
"SPLIT_PENALTY_IMPORT_NAMES": 0,
// The penalty of splitting the line around the 'and' and 'or' operators.
"SPLIT_PENALTY_LOGICAL_OPERATOR": 300,
},
*/
// pass source code on stdin (otherwise, a temporary file is used). only
// when this option is enabled yapf will pick up the style as described
// in yapf --help. disable this option in case of UnicodeEncodeErrors
// (see https://github.com/jason-kane/PyYapf/issues/36, as well as
// https://github.com/jason-kane/PyYapf/issues/20 and the related
// upstream bug https://github.com/google/yapf/pull/145)
"use_stdin": true,
// add extra output to the console for debugging pyyapf/yapf behavior
"debug": false
}