-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: enforcing MISRA compliant Boolean values #7110
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
damn, I'm too slow. Anyway, shouldn't this go into addons/misra.py ? I would guess Rule 23.6 |
Thanks for the suggestion, @okias. I am fairly new to this MISRA thing. I just read the discussion in the thread commaai/panda#1876 and this way looked like what adding the check into ustream meant. Can you please help identify if that's the right way to do that? Adding a check into upstream without explicitly defining an addon code. |
In general, a C++ solution like the one you wrote looks better, but I understood it as part of the MISRA plugin—something like this: okias@6b3d84a. The code doesn't detect the initial |
Thanks. Now I get the point. I would implement it the MISRA plugin way if this one is rejected by the maintainers. |
Hi, sorry for the late review. I spontanously feel this might be too "stylistic" in nature. It's not to find "buggy" code, is it? What bugs could it lead to? Normally I like if "style" checkers have a motivation to prevent some possible bugs. For instance; unread variables can for instance indicate an overlook. I wouldn't normally write In my humble opinion it does not violate MISRA 23.6 but it does violate 10.3 and Cppcheck Premium writes a warning about it. |
The implementation: I don't have major complaints. It's pretty good. But some test cases is needed and also I think a ticket should be added in trac and the release notes would need to mention the new checker.. |
Thanks for the inputs. This would not help prevent bugs to the code but would help increase readability at some places. I would add the required test cases. Can you please elaborate that trac thing. How can I file a ticket out there? |
well.. I don't know why anybody would WANT to do this.. but still I don't have a very good feeling about this. This is not the high prio findings users want to see. Could you try to write a checker that looks for "mistakes" somehow? I believe trac has many suggestions as inspiration. to get an account on trac you'll need to send a htpasswd hash to me. You can generate a htpasswd hash online, google "htpasswd hash generator" |
This PR adds a literal to boolean style check.
ref: commaai/panda#1876, commaai/panda#2105