cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

reduced usage of `os.chdir()` in Python scripts

Open firewave opened this issue 1 year ago • 5 comments

firewave avatar Jun 11 '24 10:06 firewave

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

firewave avatar Jun 11 '24 10:06 firewave

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 avatar Jun 23 '25 15:06 firewave

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.

danmar avatar Jun 23 '25 19:06 danmar

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.

firewave avatar Jun 23 '25 19:06 firewave

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.

danmar avatar Jun 23 '25 20:06 danmar