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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

"!" in exceptions.json syntax is confusing #14

Open
asmaloney opened this issue Mar 7, 2023 · 2 comments
Open

"!" in exceptions.json syntax is confusing #14

asmaloney opened this issue Mar 7, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@asmaloney
Copy link
Contributor

(From short discussion in this issue.)

When reading the exceptions.json file, I was reading "!ignore" as "not ignore" which really didn't make sense 馃槃 Even reading the docs on it didn't really clarify it for me.

I would suggest changing the way these are marked up to avoid this confusion.

Thinking out loud (and not having a picture of where you want to take this), I wonder if having a "traits" or "flags" or "attributes" field that allows for multiple boolean things would make sense? Something like:

"traits": "trait1, trait2, ignore"

Maybe then "!" can actually become "not":

"traits": "comment, ignore"

vs.

"traits": "!comment, ignore"

This would allow for future expansion of this kind of thing without adding new fields for each.

@asmaloney
Copy link
Contributor Author

(Now that I see you can have both "comment" and "!comment" in the same block, my example doesn't make as much sense...)

@bbredesen
Copy link
Owner

(Now that I see you can have both "comment" and "!comment" in the same block, my example doesn't make as much sense...)

"Can have" doesn't mean too much, because the format grew organically during development based on the needs of the moment, not according to a well thought out plan. I wanted to document what was going on in the file, and had to deal with JSON not having any way to add comments to the format, while also being able to add comments that go into the generated code.

I like the traits concept and it is analogous to struct tags in Go, but it leads down the path of meta-programming and might be an unnecessary level of indirection.

@bbredesen bbredesen added the enhancement New feature or request label Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants