Commit cf66c478 authored by Jérome Perrin's avatar Jérome Perrin

monaco_editor: set allow_split_before_dict_value in yapf config

This fixes dict formatting which was formatted like this with too long
values:

  {
    "a":
    "b"
  }
parent fd0ec9b3
import ast
import enum
import json
import logging
import tempfile
import textwrap
import logging
import six
logger = logging.getLogger(__name__)
......@@ -112,7 +114,7 @@ def ERP5Site_getPythonCodeSymbolList(self, data, REQUEST=None):
def ERP5Site_formatPythonSourceCode(self, data, REQUEST=None):
from yapf.yapflib import yapf_api
if isinstance(data, basestring):
if isinstance(data, six.string_types):
data = json.loads(data)
try:
extra = {}
......@@ -130,6 +132,7 @@ def ERP5Site_formatPythonSourceCode(self, data, REQUEST=None):
split_before_expression_after_opening_paren = true
split_before_first_argument = true
split_before_arithmetic_operator = true
allow_split_before_dict_value = false
'''))
f.flush()
formatted_code, changed = yapf_api.FormatCode(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment