You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(defunruby-flymake-rubocop--use-bundler-p (dir)
nil)
(defunruby-flymake-rubocop (report-fn&rest_args)
"RuboCop backend for Flymake."
(unless (executable-find"rubocop")
(error"Cannot find the rubocop executable"))
(let ((command (list"docker""compose""exec""-T""web""bundle""exec""rubocop""--stdin" buffer-file-name "--format""emacs""--cache""false"; Work around a bug in old version."--display-cop-names"))
(default-directory default-directory)
config-dir)
(when buffer-file-name
(setq config-dir "/turdle")
(if (not config-dir)
(setq command (append command '("--lint")))
(setq command (append command (list"--config""/turdle/.rubocop.yml")))
(when (ruby-flymake-rubocop--use-bundler-p config-dir)
(setq command (append '("bundle""exec") command))
;; In case of a project with multiple nested subprojects,;; each one with a Gemfile.
(setq default-directory config-dir)))
(ruby-flymake--helper
"rubocop-flymake"
command
(lambda (procsource)
;; Finding the executable is no guarantee of;; rubocop working, especially in the presence;; of rbenv shims (which cross ruby versions).
(when (eq (process-exit-status proc) 127)
;; Not sure what to do in this case. Maybe ideally we'd;; switch back to ruby-flymake-simple.
(flymake-log:warning"RuboCop returned status 127: %s"
(buffer-string)))
(goto-char (point-min))
(cl-loopwhile (search-forward-regexp"^\\(?:.*.rb\\|-\\):\\([0-9]+\\):\\([0-9]+\\): \\(.*\\)$"nilt)
for msg = (match-string3)
for (beg . end) = (flymake-diag-regionsource
(string-to-number (match-string1))
(string-to-number (match-string2)))
for type = (cond
((string-match"^[EF]: " msg)
:error)
((string-match"^W: " msg)
:warning)
(t:note))
collect (flymake-make-diagnosticsource
beg
end
type
(substring msg 3))
into diags
finally (funcall report-fn diags)))))))