Skip to content
Snippets Groups Projects
Commit 5d2d2d26 authored by Campbell Barton's avatar Campbell Barton
Browse files

code_clean: add 'use_zero_before_float_suffix' edit

parent 06cbc0b6
No related branches found
No related tags found
No related merge requests found
...@@ -218,6 +218,38 @@ def edit_list_from_file__use_const(_source, data): ...@@ -218,6 +218,38 @@ def edit_list_from_file__use_const(_source, data):
return edits return edits
def edit_list_from_file__use_zero_before_float_suffix(_source, data):
edits = []
# Replace:
# 1.f
# With:
# 1.0f
for match in re.finditer(r"\b(\d+)\.([fF])\b", data):
print(match.groups())
edits.append((
match.span(),
'%s.0%s' % (match.group(1), match.group(2)),
'__ALWAYS_FAIL__',
))
# Replace:
# 1.0F
# With:
# 1.0f
for match in re.finditer(r"\b(\d+\.\d+)F\b", data):
print(match.groups())
edits.append((
match.span(),
'%sf' % (match.group(1),),
'__ALWAYS_FAIL__',
))
return edits
def edit_list_from_file__use_const_vars(_source, data): def edit_list_from_file__use_const_vars(_source, data):
edits = [] edits = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment