Skip to content

Commit 0d6b333

Browse files
committed
mitigated pylint findings from CI
1 parent 7cd2031 commit 0d6b333

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/scriptcheck.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
python -m pip install pygments
9090
python -m pip install requests
9191
python -m pip install psutil
92+
python -m pip install setuptools
9293
9394
- name: run Shellcheck
9495
if: matrix.python-latest

addons/namingng.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def report_pending_ifndef(directive,column):
208208

209209
last_fn = None
210210
pending_ifndef = None
211+
guard_column = None
211212
phase = 0
212213
for directive in cfg.directives:
213214
if last_fn != directive.file:
@@ -263,7 +264,7 @@ def report_pending_ifndef(directive,column):
263264
if pending_ifndef:
264265
report_pending_ifndef(pending_ifndef,guard_column)
265266

266-
def process(dumpfiles, configfile):
267+
def process(dumpfiles, configfile, cli):
267268
conf = loadConfig(configfile)
268269

269270
# pylint: disable-next=no-member - TODO: fix this
@@ -275,7 +276,7 @@ def process(dumpfiles, configfile):
275276
for afile in dumpfiles:
276277
if not afile[-5:] == '.dump':
277278
continue
278-
if not args.cli:
279+
if not cli:
279280
print('Checking ' + afile + '...')
280281
data = cppcheckdata.CppcheckData(afile)
281282
process_data(conf,data)
@@ -416,6 +417,6 @@ def process_data(conf,data):
416417
help="Naming check config file")
417418

418419
args = parser.parse_args()
419-
process(args.dumpfile, args.configfile)
420+
process(args.dumpfile, args.configfile, args.cli)
420421

421422
sys.exit(0)

htmlreport/cppcheck-htmlreport

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,11 +888,12 @@ def main() -> None:
888888
except KeyError:
889889
pass
890890

891+
cwe_url = ""
891892
try:
892893
if error['cwe']:
893894
cwe_url = "<a href=\"https://cwe.mitre.org/data/definitions/" + error['cwe'] + ".html\">" + error['cwe'] + "</a>"
894895
except KeyError:
895-
cwe_url = ""
896+
pass
896897

897898
if error['severity'] in ['error', 'warning']:
898899
message_class = error['severity']

tools/donate-cpu-server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/
2727
# Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic
2828
# changes)
29-
SERVER_VERSION = "1.3.53"
29+
SERVER_VERSION = "1.3.54"
3030

3131
OLD_VERSION = '2.14.0'
3232

@@ -1204,7 +1204,7 @@ def run(self):
12041204
text = check_library_function_name(self.resultPath, var_name, queryParams, nonfunc_id='unknownMacro')
12051205
httpGetResponse(self.connection, text, 'text/plain')
12061206
else:
1207-
filename = resultPath + url
1207+
filename = self.resultPath + url
12081208
if not os.path.isfile(filename):
12091209
print_ts('HTTP/1.1 404 Not Found')
12101210
self.connection.send(b'HTTP/1.1 404 Not Found\r\n\r\n')

tools/matchcompiler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,8 @@ def convertFile(self, srcname, destname, line_directive):
691691
for line in srclines:
692692
if not modified:
693693
line_orig = line
694+
else:
695+
line_orig = None
694696

695697
linenr += 1
696698
# Compile Token::Match and Token::simpleMatch

0 commit comments

Comments
 (0)