-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
tools: eslint rule to disallow Unicode quotes #17934
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SirR4T, thank you for working on this. This is a good start!
Since the main reason for this rule is to allow source files to take up less space, we would ideally include a rule for all non-ASCII characters rather than just quotation marks.
Also, since this likely breaks some of our tests, those should have eslint comments added to disable this rule as appropriate.
a4c77bd
to
92d18fe
Compare
thanks @apapirovski for the encouraging comments! I added the eslint disabling guards, for all the tests which were failing. After adding another rule, though, for all non-ASCII characters (using I expect that eslint disabling guards should be added to benchmarks which are failing, similar to the tests, but that I should rather be trying to fix the other errors. Would that be correct? FYI, 1329 errors are due to the above linter rule alone. Should I be fixing them in multiple PRs? or in one PR alone? |
This should only be in effect for Also, like @vsemozhetbyt said in that issue, this lint rule would currently only catch forbidden characters inside of strings, as far as I can tell, although we probably want them for all source text in |
This is somewhat complicated by the fact that |
Hmm. how would i go about writing a custom rule, for |
For files outside of
I’m not sure, but all of the current custom rules for |
tests would need to use non-ASCII quotes, as part of string tests. Disable the linter rule for them.
@addaleax : just went through pull #11371 ... should I attempt to revive that? although I should admit, i might need more help with the review comments there. |
@SirR4T Yes, that sounds like a good approach. Don’t worry about that, I’d just try to re-implement as much of that patch as possible, get as far as you can with the review comments and open a PR. It should be pretty doable to bring it over the line from there. :) |
Cool, closing this PR then. Will create a new one, basing the approach on above. |
Fixes: #11209
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)