-
-
Notifications
You must be signed in to change notification settings - Fork 542
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
When parsing DBC, make sure there are no unused VAL_ and SIG_VALTYPE_ entries #661
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 8840594508Details
💛 - Coveralls |
@andlaus do you want me to rebase this on top of master to pick up the linter fix that you just merged? |
I'm not sure about this. I do not see the benefit of raising an exception on unused values. If CANdb++ can open these files, then they are valid and we should accept them. |
that would probably a good idea... |
CANDB++ fails to open these files (and prints a very unhelpful error message). Current cantools (39.4.5) accepts these bogus/questionable files. This PR brings cantools into closer alignment with the CANDB++ parser. |
(Oops, didn't mean to close this PR!) |
I came across a DBC in the wild which contained a VAL_ line that specified the wrong frame ID for its signal. cantools accepted the DBC file, but failed to interpret the signal correctly. This commit tries to detect this DBC error by removing VAL_ choices as they are used by Messages, and raising an exception if any choices remain after parsing the entire DBC.
I came across a DBC in the wild which contained a SIG_VALTYPE_ line that specified the wrong frame ID for its signal. cantools accepted the DBC file, but failed to interpret the signal correctly. This commit tries to detect this DBC error by removing SIG_VALTYPE_ choices from the signal_types dict as they are used by Messages, and raising an exception if any entries remain after parsing the entire DBC.
And this latest force-push should fix the ruff linter error i introduced. 🙄 Sorry for all the churn... |
This makes DBC parsing a little more strict, rejecting DBCs with some common(?) errors.