Skip to content

scriptcheck.yml: re-enabled pylint and mitigated findings / added missing files to Python syntax and lint check#6464

Merged
firewave merged 6 commits intocppcheck-opensource:mainfrom
firewave:pylint-xx
Jun 11, 2024
Merged

scriptcheck.yml: re-enabled pylint and mitigated findings / added missing files to Python syntax and lint check#6464
firewave merged 6 commits intocppcheck-opensource:mainfrom
firewave:pylint-xx

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread addons/namingng.py
def report(directive,msg,errorId,column=0):
reportNamingError(directive,msg,errorId,column=column)
def report(directive,msg,errorId,severity='style',column=0):
reportNamingError(directive,msg,errorId,severity=severity,column=column)
Copy link
Copy Markdown
Collaborator Author

@firewave firewave May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thingsconnected FYI - introduced in 8261ded.

Comment thread addons/namingng.py Outdated
def process(dumpfiles, configfile):
conf = loadConfig(configfile)

# pylint: disable-next=no-member - TODO: fix this
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thingsconnected I do not understand why this is not triggered for the other cases where this class is used.

Comment thread addons/namingng.py Outdated
# pylint: disable-next=no-member - TODO: fix this
if conf.include_guard:
global include_guard_header_re
# pylint: disable-next=no-member - TODO: fix this
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thingsconnected see above

full_path = os.path.join(path, file)
path, filename = os.path.split(full_path)

cwd = os.getcwd()
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danmar This was introduced in c48fc9e. If possible you should avoid using chdir().

I will replace this with the proper usage of the cwd parameter in the subprocess.check_output() in a follow-up PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I agree chdir() should not be used if it can be avoided. :-(

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of them can actually: #6510.

Comment thread addons/misra.py
self.insert_in_dict(extern_var_without_def, tok.str, tok)
else:
self.insert_in_dict(extern_var_without_def, var.nameToken.str, var.nameToken)
self.insert_in_dict(extern_var_without_def, var.nameToken.str, var.nameToken)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swasti16 FYI - introduced in ea65c09.

@firewave
Copy link
Copy Markdown
Collaborator Author

@thingsconnected still two warnings I have not fixed yet:

addons/namingng.py:223:24: E0606: Possibly using variable 'include_guard_header_re' before assignment (possibly-used-before-assignment)
addons/namingng.py:315:11: E0606: Possibly using variable 'args' before assignment (possibly-used-before-assignment)

@firewave
Copy link
Copy Markdown
Collaborator Author

I addressed all findings.

@firewave firewave force-pushed the pylint-xx branch 3 times, most recently from 28f93bb to f00c7c4 Compare June 10, 2024 10:46
@firewave firewave marked this pull request as ready for review June 10, 2024 10:48
@firewave firewave merged commit 06ce840 into cppcheck-opensource:main Jun 11, 2024
@firewave firewave deleted the pylint-xx branch June 11, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants