emacs-elsa / Elsa

Emacs Lisp Static Analyzer and gradual type system.
GNU General Public License v3.0
644 stars 27 forks source link

Rewrite all the elsa style checks to report the actual forms in the hint and not just a placeholder #102

Open Fuco1 opened 6 years ago

Fuco1 commented 6 years ago

See

(cl-defmethod elsa-check-check ((_ elsa-check-elsa-prefer-elsa-get-name) form scope state)
  (let* ((prop (elsa-get-name (elsa-nth 2 form))))
    (when (eq prop 'name)
      (elsa-state-add-message state
        (elsa-make-notice (elsa-car form)
          "Prefer (elsa-get-name %s) to (oref %s name)."
          (elsa-form-print (elsa-cadr form))
          (elsa-form-print (elsa-cadr form)))))))

it actually uses the form which is being linted and not just "use (foo x) instead of (oref x foo)"