Skip to content

reduced usage of os.chdir() in Python scripts#6510

Merged
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:py-chdir
Jun 26, 2025
Merged

reduced usage of os.chdir() in Python scripts#6510
firewave merged 1 commit intocppcheck-opensource:mainfrom
firewave:py-chdir

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

@firewave
Copy link
Copy Markdown
Collaborator Author

Still a draft because I have not tested the non-tests scripts yet.

@firewave
Copy link
Copy Markdown
Collaborator Author

Even without my change test-my-pr.py fails for me:

$ python3 tools/test-my-pr.py
Namespace(j=1, p=256, packages=None, packages_path=None, o='my_check_diff.log', c_only=False, cpp_only=False, work_path='/home/sshuser/cppcheck-test-my-pr-workfolder')
using 'make'
Checking out main
Already on 'main'
Your branch is up to date with 'origin/main'.
Pulling main
Already up to date.
No changes detected
fatal: Not a valid object name origin/main
Error: Command '['git', 'merge-base', 'origin/main', 'HEAD']' returned non-zero exit status 128.
Failed to switch to common ancestor of your branch and main

@firewave firewave marked this pull request as ready for review June 23, 2025 15:01
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Jun 23, 2025

Even without my change test-my-pr.py fails for me:

I am confused I have run that script now and then. Ludvig executed it last week on the branch where he tries to handle unnamed bitfield members . We used the --packages-path option but I don't see how that would change anything.

@firewave
Copy link
Copy Markdown
Collaborator Author

I am confused I have run that script now and then. Ludvig executed it last week on the branch where he tries to handle unnamed bitfield members . We used the --packages-path option but I don't see how that would change anything.

If one of you is able to run it with the changes I think it would be fine to merge.

I tested the htmlreport locally and it also has unit tests.

@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Jun 23, 2025

If one of you is able to run it with the changes I think it would be fine to merge.

I ran test-my-pr on 4-5 packages and don't see such problems.

@firewave firewave merged commit 4780cd2 into cppcheck-opensource:main Jun 26, 2025
53 checks passed
@firewave firewave deleted the py-chdir branch June 26, 2025 12:24
winterz pushed a commit to winterz/cppcheck that referenced this pull request Jun 30, 2025
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