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

Add ability to toggle certain warnings off #12

Closed
mateenkasim opened this issue Jul 3, 2024 · 3 comments
Closed

Add ability to toggle certain warnings off #12

mateenkasim opened this issue Jul 3, 2024 · 3 comments

Comments

@mateenkasim
Copy link

mateenkasim commented Jul 3, 2024

First of all, thanks for making this extension and LSP! The coloring, hovers, and lint are awesome to have during schema development. 🎉

Onto the issue: My schema has something similar to this:

definition folder {
    relation editor: user
    permission create_child_folder = editor
    // ... etc
}

This produces this warning:
Permission "create_child_folder" references parent type "folder" in its name; it is recommended to drop the suffix

I understand what this warning is getting at, but it's not exactly relevant in this case – the "child_folder" just happens to be the same resource as the parent "folder", hence the suffix. Since other warnings are still valuable, it would be great to selectively turn off this warning.

Generally, I'd like to toggle on/off whatever warnings are best for me. Perhaps a // zed-disable-warning: parent-name-in-suffix at the top of the file, or something in the .vscode/settings file?

@josephschorr
Copy link
Member

@mateenkasim Mind filing this against SpiceDB itself? All the diagnostics are generated by this package: https://github.com/authzed/spicedb/blob/main/pkg/development/warningdefs.go

@josephschorr
Copy link
Member

Should be easy to add something that uses the comment metadata on the nodes and disables it

@mateenkasim
Copy link
Author

Happy to!

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