-
Notifications
You must be signed in to change notification settings - Fork 2
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 checks for tree-sitter definitions #14
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.
This commit is fine: scanning another known variable that is used in several files increases the relint catchment to a useful degree, and there seems to be no risk for false positives. (No true positives either so far, but it certainly won't hurt.)
I would probably have done without the new defconst
since it's just two names instead of one, but you don't need to change that.
That previous comment was just about the first commit. The other one is more substantive and I haven't looked through it yet. |
There seem to be at least one error that relint should have caught but didn't (ruby-ts-mode.el:1024). That indicates a need to traverse arguments of at least |
ab78f44
to
16c5906
Compare
Well noticed. I've now added what I think is pretty complete coverage of the relevant Will you report/fix the |
Nice, did it catch anything else?
Please do. |
No, only the
|
Excellent, thank you very much! |
Building on your work, I improved the accuracy for treesit query regexps a little. |
Excellent, thank you very much! |
These issues were caught by modified versions of the GNU ELPA packages xr and relint: - mattiase/xr#6 - mattiase/relint#14 * lisp/gnus/gnus-art.el (gnus-parse-news-url): Remove redundant numbered group and calls to match-string. * lisp/progmodes/c-ts-mode.el (c-ts-mode--c-or-c++-regexp): Fix shy group mistyped as optional colon (bug#64019#29). * lisp/vc/vc-git.el (vc-git-annotate-time): Ditto. Also fix timezone parsing by using iso8601-parse (bug#64069). * test/lisp/vc/vc-git-tests.el (vc-git-test-annotate-time): New test.
The shy groups were caught by modified versions of the GNU ELPA packages xr and relint: - mattiase/xr#6 - mattiase/relint#14 * lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special character in regexp. * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): * lisp/progmodes/js.el (js--plain-method-re): (js--treesit-font-lock-settings): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Replace character alternative [\\d], which matches '\' or 'd', with the most likely intention [0-9]. Fix shy groups mistyped as optional colons. Remove unneeded numbered :match group in rust-ts-mode (bug#64019).
This was originally installed on 2023-06-17 in the emacs-29 release branch and later reverted. The intention is to backport it after Emacs 29.1 is released. The shy groups were caught by modified versions of the GNU ELPA packages xr and relint: - mattiase/xr#6 - mattiase/relint#14 * lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special character in regexp. * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): * lisp/progmodes/js.el (js--plain-method-re): (js--treesit-font-lock-settings): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Replace character alternative [\\d], which matches '\' or 'd', with the most likely intention [0-9]. Fix shy groups mistyped as optional colons. Remove unneeded numbered :match group in rust-ts-mode (bug#64019).
This was originally installed on 2023-06-17 in the emacs-29 release branch and later reverted. This backport follows the Emacs 29.1 release (bug#64019). The shy groups were caught by modified versions of the GNU ELPA packages xr and relint: - mattiase/xr#6 - mattiase/relint#14 * lisp/progmodes/ruby-ts-mode.el (ruby-ts--s-p-query): Quote special character in regexp. * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): * lisp/progmodes/js.el (js--plain-method-re): (js--treesit-font-lock-settings): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Replace character alternative [\\d], which matches '\' or 'd', with the most likely intention [0-9]. Fix shy groups mistyped as optional colons. Remove unneeded numbered :match group in rust-ts-mode. (cherry picked from commit cd8d3f3)
This is an initial attempt to check the following Emacs 29 additions:
treesit-defun-type-regexp
treesit-font-lock-rules
treesit-sentence-type-regexp
treesit-sexp-type-regexp
treesit-simple-imenu-settings
treesit-simple-indent-rules
Marking the PR as draft because testing is incomplete.
I should be able to finish up with testing this week.
In the meantime I was hoping to get feedback on whether:
and suggestions for improvements.
BTW, these checks have already been run against
emacs-29
:the log is attached in PR mattiase/xr#6.
Thanks!