Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix casing in variable name #5778

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Conversation

EricSesterhennX41
Copy link
Contributor

The attribute movedValue is misspelled with an uppercase V, this leads to errors when printing token values:

$ python3 runaddon.py test.py test.c.dump 
Checking test.c.dump...
Checking test.c.dump, config ...
line 2 str=""lala\n""
Traceback (most recent call last):
  File "/home/eric/tools/cppcheck/addons/runaddon.py", line 11, in <module>
    cppcheck.runcheckers()
  File "/home/eric/tools/cppcheck/addons/cppcheck.py", line 39, in runcheckers
    c(cfg, data)
  File "test.py", line 9, in func
    print(f'    {value}')
  File "/home/eric/tools/cppcheck/addons/cppcheckdata.py", line 907, in __repr__
    ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
  File "/home/eric/tools/cppcheck/addons/cppcheckdata.py", line 907, in <genexpr>
    ", ".join(("{}={}".format(a, repr(getattr(self, a))) for a in attrs))
AttributeError: 'Value' object has no attribute 'movedValue'

@danmar danmar merged commit 3b1c701 into danmar:main Dec 18, 2023
68 checks passed
@firewave
Copy link
Collaborator

I would have liked to have a unit test for this fix.

@EricSesterhennX41
Copy link
Contributor Author

EricSesterhennX41 commented Dec 19, 2023 via email

@danmar
Copy link
Owner

danmar commented Dec 19, 2023

@firewave
hmm I thought so too at first but firstly the doxygen comment fix can't be unit tested.

the other fix is not very testable neither. The code is used in two cases for debugging:

  • if you run a python debugger and in the debugger write : print(value)
  • if you put a temporary print(value) in the addon code for debugging purposes

I assumed it will have no runtime impact for our users.

@danmar
Copy link
Owner

danmar commented Dec 19, 2023

@EricSesterhennX41 we don't have a specific cppcheckdata.py test as far as I know. Feel free to create it.

@EricSesterhennX41
Copy link
Contributor Author

EricSesterhennX41 commented Dec 20, 2023 via email

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.

3 participants