/ .style.yapf
.style.yapf
1 [style] 2 # Align closing bracket with visual indentation. 3 align_closing_bracket_with_visual_indent=True 4 5 # Allow dictionary keys to exist on multiple lines. For example: 6 # 7 # x = { 8 # ('this is the first element of a tuple', 9 # 'this is the second element of a tuple'): 10 # value, 11 # } 12 allow_multiline_dictionary_keys=False 13 14 # Allow lambdas to be formatted on more than one line. 15 allow_multiline_lambdas=False 16 17 # Allow splits before the dictionary value. 18 allow_split_before_dict_value=True 19 20 # Number of blank lines surrounding top-level function and class 21 # definitions. 22 blank_lines_around_top_level_definition=2 23 24 # Insert a blank line before a class-level docstring. 25 blank_line_before_class_docstring=False 26 27 # Insert a blank line before a module docstring. 28 blank_line_before_module_docstring=False 29 30 # Insert a blank line before a 'def' or 'class' immediately nested 31 # within another 'def' or 'class'. For example: 32 # 33 # class Foo: 34 # # <------ this blank line 35 # def method(): 36 # ... 37 blank_line_before_nested_class_or_def=False 38 39 # Do not split consecutive brackets. Only relevant when 40 # dedent_closing_brackets is set. For example: 41 # 42 # call_func_that_takes_a_dict( 43 # { 44 # 'key1': 'value1', 45 # 'key2': 'value2', 46 # } 47 # ) 48 # 49 # would reformat to: 50 # 51 # call_func_that_takes_a_dict({ 52 # 'key1': 'value1', 53 # 'key2': 'value2', 54 # }) 55 coalesce_brackets=False 56 57 # The column limit. 58 column_limit=160 59 60 # The style for continuation alignment. Possible values are: 61 # 62 # - SPACE: Use spaces for continuation alignment. This is default behavior. 63 # - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns 64 # (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs) for continuation 65 # alignment. 66 # - LESS: Slightly left if cannot vertically align continuation lines with 67 # indent characters. 68 # - VALIGN-RIGHT: Vertically align continuation lines with indent 69 # characters. Slightly right (one more indent character) if cannot 70 # vertically align continuation lines with indent characters. 71 # 72 # For options FIXED, and VALIGN-RIGHT are only available when USE_TABS is 73 # enabled. 74 continuation_align_style=SPACE 75 76 # Indent width used for line continuations. 77 continuation_indent_width=4 78 79 # Put closing brackets on a separate line, dedented, if the bracketed 80 # expression can't fit in a single line. Applies to all kinds of brackets, 81 # including function definitions and calls. For example: 82 # 83 # config = { 84 # 'key1': 'value1', 85 # 'key2': 'value2', 86 # } # <--- this bracket is dedented and on a separate line 87 # 88 # time_series = self.remote_client.query_entity_counters( 89 # entity='dev3246.region1', 90 # key='dns.query_latency_tcp', 91 # transform=Transformation.AVERAGE(window=timedelta(seconds=60)), 92 # start_ts=now()-timedelta(days=3), 93 # end_ts=now(), 94 # ) # <--- this bracket is dedented and on a separate line 95 dedent_closing_brackets=False 96 97 # Disable the heuristic which places each list element on a separate line 98 # if the list is comma-terminated. 99 disable_ending_comma_heuristic=False 100 101 # Place each dictionary entry onto its own line. 102 each_dict_entry_on_separate_line=True 103 104 # The regex for an i18n comment. The presence of this comment stops 105 # reformatting of that line, because the comments are required to be 106 # next to the string they translate. 107 i18n_comment= 108 109 # The i18n function call names. The presence of this function stops 110 # reformatting on that line, because the string it has cannot be moved 111 # away from the i18n comment. 112 i18n_function_call= 113 114 # Indent the dictionary value if it cannot fit on the same line as the 115 # dictionary key. For example: 116 # 117 # config = { 118 # 'key1': 119 # 'value1', 120 # 'key2': value1 + 121 # value2, 122 # } 123 indent_dictionary_value=False 124 125 # The number of columns to use for indentation. 126 indent_width=4 127 128 # Join short lines into one line. E.g., single line 'if' statements. 129 join_multiple_lines=True 130 131 # Do not include spaces around selected binary operators. For example: 132 # 133 # 1 + 2 * 3 - 4 / 5 134 # 135 # will be formatted as follows when configured with "*,/": 136 # 137 # 1 + 2*3 - 4/5 138 # 139 no_spaces_around_selected_binary_operators= 140 141 # Use spaces around default or named assigns. 142 spaces_around_default_or_named_assign=False 143 144 # Use spaces around the power operator. 145 spaces_around_power_operator=False 146 147 # The number of spaces required before a trailing comment. 148 spaces_before_comment=2 149 150 # Insert a space between the ending comma and closing bracket of a list, 151 # etc. 152 space_between_ending_comma_and_closing_bracket=True 153 154 # Split before arguments 155 split_all_comma_separated_values=False 156 157 # Split before arguments if the argument list is terminated by a 158 # comma. 159 split_arguments_when_comma_terminated=False 160 161 # Set to True to prefer splitting before '&', '|' or '^' rather than 162 # after. 163 split_before_bitwise_operator=True 164 165 # Split before the closing bracket if a list or dict literal doesn't fit on 166 # a single line. 167 split_before_closing_bracket=True 168 169 # Split before a dictionary or set generator (comp_for). For example, note 170 # the split before the 'for': 171 # 172 # foo = { 173 # variable: 'Hello world, have a nice day!' 174 # for variable in bar if variable != 42 175 # } 176 split_before_dict_set_generator=True 177 178 # Split before the '.' if we need to split a longer expression: 179 # 180 # foo = ('This is a really long string: {}, {}, {}, {}'.format(a, b, c, d)) 181 # 182 # would reformat to something like: 183 # 184 # foo = ('This is a really long string: {}, {}, {}, {}' 185 # .format(a, b, c, d)) 186 split_before_dot=False 187 188 # Split after the opening paren which surrounds an expression if it doesn't 189 # fit on a single line. 190 split_before_expression_after_opening_paren=False 191 192 # If an argument / parameter list is going to be split, then split before 193 # the first argument. 194 split_before_first_argument=False 195 196 # Set to True to prefer splitting before 'and' or 'or' rather than 197 # after. 198 split_before_logical_operator=True 199 200 # Split named assignments onto individual lines. 201 split_before_named_assigns=True 202 203 # Set to True to split list comprehensions and generators that have 204 # non-trivial expressions and multiple clauses before each of these 205 # clauses. For example: 206 # 207 # result = [ 208 # a_long_var + 100 for a_long_var in xrange(1000) 209 # if a_long_var % 10] 210 # 211 # would reformat to something like: 212 # 213 # result = [ 214 # a_long_var + 100 215 # for a_long_var in xrange(1000) 216 # if a_long_var % 10] 217 split_complex_comprehension=False 218 219 # The penalty for splitting right after the opening bracket. 220 split_penalty_after_opening_bracket=30 221 222 # The penalty for splitting the line after a unary operator. 223 split_penalty_after_unary_operator=10000 224 225 # The penalty for splitting right before an if expression. 226 split_penalty_before_if_expr=0 227 228 # The penalty of splitting the line around the '&', '|', and '^' 229 # operators. 230 split_penalty_bitwise_operator=300 231 232 # The penalty for splitting a list comprehension or generator 233 # expression. 234 split_penalty_comprehension=80 235 236 # The penalty for characters over the column limit. 237 split_penalty_excess_character=7000 238 239 # The penalty incurred by adding a line split to the unwrapped line. The 240 # more line splits added the higher the penalty. 241 split_penalty_for_added_line_split=30 242 243 # The penalty of splitting a list of "import as" names. For example: 244 # 245 # from a_very_long_or_indented_module_name_yada_yad import (long_argument_1, 246 # long_argument_2, 247 # long_argument_3) 248 # 249 # would reformat to something like: 250 # 251 # from a_very_long_or_indented_module_name_yada_yad import ( 252 # long_argument_1, long_argument_2, long_argument_3) 253 split_penalty_import_names=0 254 255 # The penalty of splitting the line around the 'and' and 'or' 256 # operators. 257 split_penalty_logical_operator=300 258 259 # Use the Tab character for indentation. 260 use_tabs=False 261