summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPhilipp Weissenbacher <p.weissenbacher@gmail.com>2014-07-23 00:26:08 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-07-23 08:02:07 +0000
commit192338bbc363bbcf71ddbfff8f933d69a822c215 (patch)
treec2f7143c35e5a25aafb97395c8262ebcfdbe042a /bin
parent8f4cba868677a60ff8a9e9b3ea7a05bdc206bcc0 (diff)
Run pylint on find-german-comments
I ran pylint and corrected the following errors: * W: 39,0: Unnecessary semicolon * W:177,0: Bad indentation. Found 19 spaces, expected 20 * W:178,0: Bad indentation. Found 19 spaces, expected 20 * W:213,0: Unnecessary semicolon * W: 65,8:Parser.get_comments: Unused variable 'linenum' * C:190,28:Parser.check_file: Operator not preceded by a space * C:192,24:Parser.check_file: Operator not followed by a space * C:196,24:Parser.check_file: Comma not followed by a space * W:223,33:Parser.check_source_files: Redefining built-in 'dir' Change-Id: Idd4986fecb7b3a2af87d1062b7d08c6c87b9f80f Reviewed-on: https://gerrit.libreoffice.org/10475 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/find-german-comments18
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/find-german-comments b/bin/find-german-comments
index 155d9d635f51..f040f89b45ad 100755
--- a/bin/find-german-comments
+++ b/bin/find-german-comments
@@ -36,7 +36,7 @@ class Parser:
"""
def __init__(self):
self.strip = string.punctuation + " \n"
- self.text_cat = self.start_text_cat();
+ self.text_cat = self.start_text_cat()
op = optparse.OptionParser()
op.set_usage("%prog [options] <rootdir>\n\n" +
"Searches for german comments in cxx/hxx source files inside a given root\n" +
@@ -174,8 +174,8 @@ class Parser:
sys.stderr.write("%s ... %s positives -- %s\n" % (path, str(len(path_linenums)), str(valid)))
if valid:
if self.options.line_numbers_pos:
- sys.stderr.write("%s ... %s positives\n" % (path, str(len(path_linenums))))
- return
+ sys.stderr.write("%s ... %s positives\n" % (path, str(len(path_linenums))))
+ return
if len(path) + (len(path_linenums)*4) > 75:
print "%s:\n" % path
while(path_linenums):
@@ -187,13 +187,13 @@ class Parser:
path_linenums.remove(path_linenums[0])
except IndexError:
i = 10
- i+=1
+ i += 1
numline = [str(i) for i in numline]
- print "%s%s" %(TABS, ",".join(numline))
+ print "%s%s" % (TABS, ",".join(numline))
else:
if self.options.line_numbers:
path_linenums = [str(i) for i in path_linenums]
- print "%s:%s%s" % (path,"\t"*tab_calc(path),",".join(path_linenums))
+ print "%s:%s%s" % (path, "\t"*tab_calc(path), ",".join(path_linenums))
elif not self.options.filenames_only:
for linenum, s in self.get_comments(path):
@@ -210,7 +210,7 @@ class Parser:
print f
def first_elem(self, path):
- lastElem = os.path.dirname(path);
+ lastElem = os.path.dirname(path)
done = False
while not done:
nextElem = os.path.split(lastElem)[0]
@@ -220,11 +220,11 @@ class Parser:
done = True
return lastElem
- def check_source_files(self, dir):
+ def check_source_files(self, directory):
"""
checks each _tracked_ file in a directory recursively
"""
- sock = os.popen(r"git ls-files '%s' |egrep '\.(c|h)xx$'" % dir)
+ sock = os.popen(r"git ls-files '%s' |egrep '\.(c|h)xx$'" % directory)
lines = sock.readlines()
sock.close()