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 diagnostic for inconsistent string quoting styles #2510

Closed
wants to merge 1 commit into from

Conversation

emmericp
Copy link
Contributor

@emmericp emmericp commented Feb 2, 2024

No description provided.

@emmericp emmericp force-pushed the quote-style-diagnostic branch from e8cb22c to 9724c5e Compare February 2, 2024 22:21
@CppCXY
Copy link
Collaborator

CppCXY commented Feb 4, 2024

Why not just use codestyle-check, to keep a consistent style of quotes throughout the project?
Additionally, you did not consider the situation of '"aa"', where diagnostics should not appear

@emmericp emmericp force-pushed the quote-style-diagnostic branch from 9724c5e to 3cdd086 Compare February 4, 2024 10:16
@emmericp
Copy link
Contributor Author

emmericp commented Feb 4, 2024

Updated to not count strings that contain the other quote inside the literal, good idea!

You are probably right that this probably doesn't belong here but in codestyle-check. The main reason is that codestyle-check wants a project-level configuration to setup this, but if you work on individual scripts or files and I want to keep these consistent without additional configuration. The example that motiviated me to do this is actually the LuaLS repo itself, it doesn't setup a quote style for codestyle-check and I kept using the wrong quotes without anything warning me.

And finally I mainly did this as an exercise to understand how diagnostics work, so I'm not sad if this doesn't end up getting merged.

@ari-party
Copy link

This would still be nice.

@sumneko
Copy link
Collaborator

sumneko commented Feb 19, 2024

Thank you for your PR! As mentioned earlier, this should be the job of codestyle-check. Your specific file diagnostic needs can be discussed separately.

@sumneko sumneko closed this Feb 19, 2024
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

Successfully merging this pull request may close these issues.

4 participants