Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
255d9824
Commit
255d9824
authored
Jul 12, 2022
by
AnimeGitB
Committed by
Luke H-W
Jul 12, 2022
Browse files
Make whitespace formatter only target 8e3deb9
parent
54548fd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
format_whitespace.py
View file @
255d9824
...
...
@@ -16,14 +16,16 @@ re_keyword_space = re.compile(r'(?<=\b)(if|for|while|switch|try|else|catch|final
def
get_changed_filelist
():
subprocess
.
run
([
'git'
,
'fetch'
,
UPSTREAM
,
f
'
{
RATCHET
}
:
{
RATCHET
}
'
])
# Ensure LintRatchet ref is matched to upstream
result
=
subprocess
.
run
([
'git'
,
'diff'
,
RATCHET
,
'--name-only'
],
capture_output
=
True
,
text
=
True
)
# subprocess.run(['git', 'fetch', UPSTREAM, f'{RATCHET}:{RATCHET}']) # Ensure LintRatchet ref is matched to upstream
# result = subprocess.run(['git', 'diff', RATCHET, '--name-only'], capture_output=True, text=True)
# if result.returncode != 0:
# print(f'{RATCHET} not found, trying fallback {RATCHET_FALLBACK}')
print
(
f
'Attempting to diff against
{
RATCHET_FALLBACK
}
'
)
result
=
subprocess
.
run
([
'git'
,
'diff'
,
RATCHET_FALLBACK
,
'--name-only'
],
capture_output
=
True
,
text
=
True
)
if
result
.
returncode
!=
0
:
print
(
f
'
{
RATCHET
}
not found, trying fallback
{
RATCHET_FALLBACK
}
'
)
result
=
subprocess
.
run
([
'git'
,
'diff'
,
RATCHET_FALLBACK
,
'--name-only'
],
capture_output
=
True
,
text
=
True
)
if
result
.
returncode
!=
0
:
print
(
'Fallback is also missing, aborting.'
)
exit
(
1
)
# print('Fallback is also missing, aborting.')
print
(
f
'Could not find
{
RATCHET_FALLBACK
}
, aborting.'
)
exit
(
1
)
return
result
.
stdout
.
strip
().
split
(
'
\n
'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment