mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 00:16:04 +08:00
single-value-single-line formatting
Need to figure out the regex expression. To only select overrides consisting of a single value
This commit is contained in:
parent
67688aad95
commit
187dfe1210
@ -9,6 +9,7 @@ format:
|
||||
format-definition-paired-coordinate-array: true
|
||||
format-definition-sort-keys: true
|
||||
format-definition-indent: 4
|
||||
format-definition-single-value-single-line: true
|
||||
format-profile-space-around-delimiters: true
|
||||
format-profile-sort-keys: true
|
||||
diagnostic-mesh-file-size: 1200000
|
@ -48,6 +48,9 @@ def formatFile(file: Path, settings):
|
||||
newline = re.compile(r"(\B\s+)(\"[\w\"]+)(\:\s\{)")
|
||||
content = newline.sub(r"\1\2:\1{", content)
|
||||
|
||||
if settings["format"].get("format-definition-single-value-single-line", True):
|
||||
pass # TODO: format entries in the override section which only define a single value to be on one line
|
||||
|
||||
if settings["format"].get("format-definition-paired-coordinate-array", True):
|
||||
paired_coordinates = re.compile(r"(\[)\s+(-?\d*),\s*(-?\d*)\s*(\])")
|
||||
content = paired_coordinates.sub(r"\1 \2, \3 \4", content)
|
||||
|
Loading…
x
Reference in New Issue
Block a user