summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils/checkstyle.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index 0e9659e9..fb9366f8 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -203,23 +203,23 @@ class CommitFile:
class Commit:
def __init__(self, commit):
self.commit = commit
- self.__parse()
+ self._parse()
- def __parse(self):
+ def _parse(self):
# Get the commit title and list of files.
ret = subprocess.run(['git', 'show', '--pretty=oneline', '--name-status',
self.commit],
stdout=subprocess.PIPE).stdout.decode('utf-8')
files = ret.splitlines()
- self.__files = [CommitFile(f) for f in files[1:]]
- self.__title = files[0]
+ self._files = [CommitFile(f) for f in files[1:]]
+ self._title = files[0]
def files(self, filter='AM'):
- return [f.filename for f in self.__files if f.status in filter]
+ return [f.filename for f in self._files if f.status in filter]
@property
def title(self):
- return self.__title
+ return self._title
def get_diff(self, top_level, filename):
diff = subprocess.run(['git', 'diff', '%s~..%s' % (self.commit, self.commit),
@@ -236,11 +236,11 @@ class StagedChanges(Commit):
def __init__(self):
Commit.__init__(self, '')
- def __parse(self):
+ def _parse(self):
ret = subprocess.run(['git', 'diff', '--staged', '--name-status'],
stdout=subprocess.PIPE).stdout.decode('utf-8')
- self.__title = "Staged changes"
- self.__files = [CommitFile(f) for f in ret.splitlines()]
+ self._title = "Staged changes"
+ self._files = [CommitFile(f) for f in ret.splitlines()]
def get_diff(self, top_level, filename):
diff = subprocess.run(['git', 'diff', '--staged', '--',
@@ -253,15 +253,15 @@ class Amendment(StagedChanges):
def __init__(self):
StagedChanges.__init__(self)
- def __parse(self):
+ def _parse(self):
# Create a title using HEAD commit
ret = subprocess.run(['git', 'show', '--pretty=oneline', '--no-patch'],
stdout=subprocess.PIPE).stdout.decode('utf-8')
- self.__title = 'Amendment of ' + ret.strip()
+ self._title = 'Amendment of ' + ret.strip()
# Extract the list of modified files
ret = subprocess.run(['git', 'diff', '--staged', '--name-status', 'HEAD~'],
stdout=subprocess.PIPE).stdout.decode('utf-8')
- self.__files = [CommitFile(f) for f in ret.splitlines()]
+ self._files = [CommitFile(f) for f in ret.splitlines()]
def get_diff(self, top_level, filename):
diff = subprocess.run(['git', 'diff', '--staged', 'HEAD~', '--',