summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-27 18:41:10 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-27 19:26:03 +0300
commit605b58efb12358ee94f56009960ef75c26f4b94d (patch)
tree25772b771310bcfbed02ebe82da955e6642a14e1
parentd1cdaeb6f078677d5bf46cb596102bfe8da070b9 (diff)
utils: checkstyle.py: Use single-quoted strings when possible
checkstyle.py uses single-quoted strings in most locations already. There are a few locations where this wouldn't be convenient (when the string itself contains a single quote, which would then require escaping), but there are also a few other locations where double quotes are used when single quotes would work fine. Change those to standardize on single-quoted strings. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rwxr-xr-xutils/checkstyle.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/checkstyle.py b/utils/checkstyle.py
index ececb46e..835f2a9f 100755
--- a/utils/checkstyle.py
+++ b/utils/checkstyle.py
@@ -239,7 +239,7 @@ class StagedChanges(Commit):
def _parse(self):
ret = subprocess.run(['git', 'diff', '--staged', '--name-status'],
stdout=subprocess.PIPE).stdout.decode('utf-8')
- self._title = "Staged changes"
+ self._title = 'Staged changes'
self._files = [CommitFile(f) for f in ret.splitlines()]
def get_diff(self, top_level, filename):
@@ -476,7 +476,7 @@ class Pep8Checker(StyleChecker):
ret = subprocess.run(['pycodestyle', '--ignore=E501', '-'],
input=data, stdout=subprocess.PIPE)
except FileNotFoundError:
- issues.append(StyleIssue(0, None, "Please install pycodestyle to validate python additions"))
+ issues.append(StyleIssue(0, None, 'Please install pycodestyle to validate python additions'))
return issues
results = ret.stdout.decode('utf-8').splitlines()
@@ -509,7 +509,7 @@ class ShellChecker(StyleChecker):
ret = subprocess.run(['shellcheck', '-Cnever', '-'],
input=data, stdout=subprocess.PIPE)
except FileNotFoundError:
- issues.append(StyleIssue(0, None, "Please install shellcheck to validate shell script additions"))
+ issues.append(StyleIssue(0, None, 'Please install shellcheck to validate shell script additions'))
return issues
results = ret.stdout.decode('utf-8').splitlines()
@@ -774,10 +774,10 @@ def check_style(top_level, commit):
issues += check_file(top_level, commit, f)
if issues == 0:
- print("No issue detected")
+ print('No issue detected')
else:
print('---')
- print("%u potential %s detected, please review" %
+ print('%u potential %s detected, please review' %
(issues, 'issue' if issues == 1 else 'issues'))
return issues
@@ -833,7 +833,7 @@ def main(argv):
for command, mandatory in dependencies.items():
found = shutil.which(command)
if mandatory and not found:
- print("Executable %s not found" % command)
+ print('Executable %s not found' % command)
return 1
dependencies[command] = found