Skip to content

Commit

Permalink
Merge pull request funkwerk#2 from doino-gretchenliev/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jhult authored Aug 30, 2021
2 parents 6038add + 23073f9 commit dbe87c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compose_format/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def format(self, path, replace=False, strict=True):

def format_string(self, data, replace=False, strict=True):
data = self.reorder(load(data, RoundTripLoader), strict=strict)
formatted = dump(data, Dumper=RoundTripDumper, indent=2, width=120)
formatted = dump(data, Dumper=RoundTripDumper,
indent=2, block_seq_indent=2, width=120)

return formatted.strip() + '\n'

Expand Down Expand Up @@ -112,7 +113,7 @@ def fix_sexadecimal_numbers(value):
import re

SEXADECIMAL_NUMBER = '(?P<left>\d+):(?P<right>\d+)'
match = re.match(SEXADECIMAL_NUMBER, value)
match = re.match(SEXADECIMAL_NUMBER, str(value))
if not match or int(match.group('left')) > 60 or int(match.group('right')) > 60:
return value
return SingleQuotedScalarString('{0}:{1}'.format(match.group('left'), match.group('right')))
Expand Down

0 comments on commit dbe87c8

Please sign in to comment.