Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4177eff0
Commit
4177eff0
authored
Jun 27, 2011
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general cleaning up
parent
fbf528f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
Tools/scripts/patchcheck.py
Tools/scripts/patchcheck.py
+3
-11
No files found.
Tools/scripts/patchcheck.py
View file @
4177eff0
...
@@ -36,7 +36,6 @@ def status(message, modal=False, info=None):
...
@@ -36,7 +36,6 @@ def status(message, modal=False, info=None):
def
changed_files
():
def
changed_files
():
"""Get the list of changed or added files from the VCS."""
"""Get the list of changed or added files from the VCS."""
if
os
.
path
.
isdir
(
'.hg'
):
if
os
.
path
.
isdir
(
'.hg'
):
vcs
=
'hg'
cmd
=
'hg status --added --modified --no-status'
cmd
=
'hg status --added --modified --no-status'
else
:
else
:
sys
.
exit
(
'need a checkout to get modified files'
)
sys
.
exit
(
'need a checkout to get modified files'
)
...
@@ -44,12 +43,7 @@ def changed_files():
...
@@ -44,12 +43,7 @@ def changed_files():
st
=
subprocess
.
Popen
(
cmd
.
split
(),
stdout
=
subprocess
.
PIPE
)
st
=
subprocess
.
Popen
(
cmd
.
split
(),
stdout
=
subprocess
.
PIPE
)
try
:
try
:
st
.
wait
()
st
.
wait
()
if
vcs
==
'hg'
:
return
[
x
.
decode
().
rstrip
()
for
x
in
st
.
stdout
]
return
[
x
.
decode
().
rstrip
()
for
x
in
st
.
stdout
]
else
:
output
=
(
x
.
decode
().
rstrip
().
rsplit
(
None
,
1
)[
-
1
]
for
x
in
st
.
stdout
if
x
[
0
]
in
b'AM'
)
return
set
(
path
for
path
in
output
if
os
.
path
.
isfile
(
path
))
finally
:
finally
:
st
.
stdout
.
close
()
st
.
stdout
.
close
()
...
@@ -69,10 +63,8 @@ def report_modified_files(file_paths):
...
@@ -69,10 +63,8 @@ def report_modified_files(file_paths):
def
normalize_whitespace
(
file_paths
):
def
normalize_whitespace
(
file_paths
):
"""Make sure that the whitespace for .py files have been normalized."""
"""Make sure that the whitespace for .py files have been normalized."""
reindent
.
makebackup
=
False
# No need to create backups.
reindent
.
makebackup
=
False
# No need to create backups.
fixed
=
[]
fixed
=
[
path
for
path
in
file_paths
if
path
.
endswith
(
'.py'
)
and
for
path
in
(
x
for
x
in
file_paths
if
x
.
endswith
(
'.py'
)):
reindent
.
check
(
path
)]
if
reindent
.
check
(
path
):
fixed
.
append
(
path
)
return
fixed
return
fixed
...
...
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