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

Enforce ARRAY_SIZE(property) == ARRAY_SIZE(property-names) #63

Open
konradybcio opened this issue Feb 27, 2023 · 2 comments
Open

Enforce ARRAY_SIZE(property) == ARRAY_SIZE(property-names) #63

konradybcio opened this issue Feb 27, 2023 · 2 comments

Comments

@konradybcio
Copy link

This is not enforced by the spec or by dtc, but sounds like something that would improve the dev experience.

@robherring
Copy link
Member

What is your expectation for adding an issue here? Do you intend to work on it? Dropping issues here is kind of a dead end. I apply patches people submit for the spec. That's the extent of spec work.

For this issue, I suppose the spec should be explicit about this though that's the whole point of .*-names. Anything the spec says should ultimately be enforced/checked by the tools to be helpful. This could go in either dtc or dtschema. dtc already knows some of the common bindings already. dtschema does too. json-schema may address this issue as constraints depending on other properties' value is on their radar. I would like to define a framework within dt-schema for adding code based checks where we could just drop new python files in to check anything. That's a bit of work. dtb.py already figures out how many entries these bindings have, so we could perhaps add in something there. It's not really setup to properly report errors back if you've noticed the errors with no filenames...

@konradybcio
Copy link
Author

What is your expectation for adding an issue here? Do you intend to work on it? Dropping issues here is kind of a dead end. I apply patches people submit for the spec. That's the extent of spec work.

[...]

This could go in either dtc or dtschema. dtc already knows some of the common bindings already. dtschema does too. json-schema may address this issue as constraints depending on other properties' value is on their radar.

Right. I was not sure where to point this out, I suppose this concerns both the spec and the tools. Probably schema would be the best choice, as it seems to be the one that's responsible for checking anything that's higher level than bare syntax and references.

For this issue, I suppose the spec should be explicit about this though that's the whole point of .*-names. Anything the spec says should ultimately be enforced/checked by the tools to be helpful.

Agreed!

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

No branches or pull requests

2 participants