-
-
Notifications
You must be signed in to change notification settings - Fork 45
Fix CI failures #218
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
Fix CI failures #218
Conversation
@bbatsov what's the best way to trigger CI? |
I'm guess for you'd it be easiest to just push changes here. I'm not sure you can run jobs directly from the console https://app.circleci.com/pipelines/github/clojure-emacs/inf-clojure |
Looking more closely at this code - it doesn't even seem that's a regexp (it's passed only to |
That was my assumption, but nothing happened. Maybe I should convert it to non-draft? |
I see. I guess we can require Emacs 28. It's fairly old by now anyways. |
One of the failing tests is: (it "computes no bounds for point directly after a break expression"
(ict-with-assess-buffers
((a (insert "@")))
(with-current-buffer a
(expect
(ict-bounds-string (inf-clojure-completion-bounds-of-expr-at-point))
:not :to-be nil)))) I honestly don't really understand what it's about and Git history doesn't give me much details either. Any tips would be welcome :) |
I guess so.
This is trying to extract the string part from some form (e.g. from |
well, test expects it to be non-nil for some reason, but |
Ah, probably it's actually supposed to be empty string when there are no relevant characters. |
Looking at the code I would assume that returning (defun inf-clojure-completion-bounds-of-expr-at-point ()
"Return bounds of expression at point to complete."
(when (not (memq (char-syntax (following-char)) '(?w ?_)))
(save-excursion
(let* ((end (point))
(skipped-back (skip-chars-backward inf-clojure-clojure-expr-break-chars))
(start (+ end skipped-back))
(chars (or (thing-at-point 'symbol)
(inf-clojure--kw-to-symbol (buffer-substring start end)))))
(when (> (length chars) 0)
(let ((first-char (substring-no-properties chars 0 1)))
(when (string-match-p "[^0-9]" first-char)
(cons (point) end))))))))
(defun inf-clojure-completion-expr-at-point ()
"Return expression at point to complete."
(let ((bounds (inf-clojure-completion-bounds-of-expr-at-point)))
(and bounds
(buffer-substring (car bounds) (cdr bounds)))))
(defun inf-clojure-completion-at-point ()
"Retrieve the list of completions and prompt the user.
Returns the selected completion or nil."
(let ((bounds (inf-clojure-completion-bounds-of-expr-at-point)))
(when (and bounds (inf-clojure-get-feature (inf-clojure-proc) 'completion 'no-error))
(list (car bounds) (cdr bounds)
(if (fboundp 'completion-table-with-cache)
(completion-table-with-cache #'inf-clojure-completions)
(completion-table-dynamic #'inf-clojure-completions)))))) |
Should I remove Emacs 27 from CI config? |
I'm fine with your proposal on both points. |
One more thing - seems the CI wasn't running for PRs from forks. Should be working properly now. (after you next change) |
Sorry for the noise again. I've done some digging in the Git history and found out that this test was introduced in this PR: #129 The original regex was
(commit 74a6fac). If I change the regex to this, the test passes, it returns the boundaries of Then in another commit (dbe2839) it was changed to the current value and this test stopped working. I'm a bit hesitant to change the regex. Maybe we should use |
I don't think (skipped-back (skip-chars-backward inf-clojure-clojure-expr-break-chars)) and this function takes a list of chars (a string). I guess we can update the tests and the wrong var description for and call it a day. |
Haha, that's what I've just figured out as well. But from the original PR I assume it should match |
a645ce1
to
450c3c0
Compare
I decided to update the test to expect
Moving characters around breaks tests, so there is still warning about duplicated brakets and I don't really know how to fix it, because it looks like a valid case to have one "special" All the tests are fixed now, @bbatsov it's ready for review. |
64c9ee4
to
faa104e
Compare
This linter is stupid :) If I remove duplicated brackets tests actually pass, but I get another linter error:
I guess it tries to lint it as an actual regex, but it's not aware that characters in this string have special meaning. |
I made the same discovery earlier today when I tried to fix this myself. Not sure how to instruct the linter to ignore this, but we'll figure it out later. |
project-root
function was introduced in Emacs 28.1. So tests fail on Emacs 27."^[] \"'
><,;|&{()[@\^]"`. I'm not sure it's an error, maybe one of the pairs should be escaped?Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
M-x checkdoc
warningsThanks!