projects
/
kconfig-hardened-check.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
40df996
)
Fix pylint warning: formatting a regular string which could be a f-string (III)
author
Alexander Popov
<alex.popov@linux.com>
Sun, 26 Feb 2023 06:37:21 +0000
(09:37 +0300)
committer
Alexander Popov
<alex.popov@linux.com>
Sun, 26 Feb 2023 06:37:21 +0000
(09:37 +0300)
Part III, strings
kconfig_hardened_check/__init__.py
patch
|
blob
|
history
diff --git
a/kconfig_hardened_check/__init__.py
b/kconfig_hardened_check/__init__.py
index 9bfb52f3520b6b2c3a39bbd7f7e75219867e4256..182b41dc856c179f69cc9ca7521acd454b11b942 100644
(file)
--- a/
kconfig_hardened_check/__init__.py
+++ b/
kconfig_hardened_check/__init__.py
@@
-231,13
+231,13
@@
class OR(ComplexOptCheck):
# Add more info for additional checks:
if i != 0:
if opt.result == 'OK':
# Add more info for additional checks:
if i != 0:
if opt.result == 'OK':
- self.result =
'OK: {} is "{}"'.format(opt.name, opt.expected)
+ self.result =
f'OK: {opt.name} is "{opt.expected}"'
elif opt.result == 'OK: is not found':
elif opt.result == 'OK: is not found':
- self.result =
'OK: {} is not found'.format(opt.name)
+ self.result =
f'OK: {opt.name} is not found'
elif opt.result == 'OK: is present':
elif opt.result == 'OK: is present':
- self.result =
'OK: {} is present'.format(opt.name)
+ self.result =
f'OK: {opt.name} is present'
elif opt.result.startswith('OK: is not off'):
elif opt.result.startswith('OK: is not off'):
- self.result =
'OK: {} is not off'.format(opt.name)
+ self.result =
f'OK: {opt.name} is not off'
else:
# VersionCheck provides enough info
assert(opt.result.startswith('OK: version')), \
else:
# VersionCheck provides enough info
assert(opt.result.startswith('OK: version')), \
@@
-263,13
+263,13
@@
class AND(ComplexOptCheck):
# and not by the main option that this AND-check is about.
# Describe the reason of the FAIL.
if opt.result.startswith('FAIL: \"') or opt.result == 'FAIL: is not found':
# and not by the main option that this AND-check is about.
# Describe the reason of the FAIL.
if opt.result.startswith('FAIL: \"') or opt.result == 'FAIL: is not found':
- self.result =
'FAIL: {} is not "{}"'.format(opt.name, opt.expected)
+ self.result =
f'FAIL: {opt.name} is not "{opt.expected}"'
elif opt.result == 'FAIL: is not present':
elif opt.result == 'FAIL: is not present':
- self.result =
'FAIL: {} is not present'.format(opt.name)
+ self.result =
f'FAIL: {opt.name} is not present'
elif opt.result in ('FAIL: is off', 'FAIL: is off, "0"'):
elif opt.result in ('FAIL: is off', 'FAIL: is off, "0"'):
- self.result =
'FAIL: {} is off'.format(opt.name)
+ self.result =
f'FAIL: {opt.name} is off'
elif opt.result == 'FAIL: is off, not found':
elif opt.result == 'FAIL: is off, not found':
- self.result =
'FAIL: {} is off, not found'.format(opt.name)
+ self.result =
f'FAIL: {opt.name} is off, not found'
else:
# VersionCheck provides enough info
self.result = opt.result
else:
# VersionCheck provides enough info
self.result = opt.result