Skip to content

Run the lisp-critic on the current file (Emacs command) #41

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

Open
vindarel opened this issue Dec 2, 2022 · 0 comments
Open

Run the lisp-critic on the current file (Emacs command) #41

vindarel opened this issue Dec 2, 2022 · 0 comments

Comments

@vindarel
Copy link
Collaborator

vindarel commented Dec 2, 2022

Let's use the lisp-critic on the current file from Emacs.

Usage: M-x slime-critique-file

This is an ELisp function.

(defun slime-critique-file ()
    "Lint this file with lisp-critic."
    (interactive)
    (slime-eval-async '(ql:quickload :lisp-critic))
    (slime-eval-async
        `(lisp-critic:critique-file ,(buffer-file-name))))

SLY version:

(defun sly-critique-file ()
    "Lint this file with lisp-critic"
    (interactive)
    (sly-eval-async '(ql:quickload :lisp-critic))
    (sly-eval-async
        `(lisp-critic:critique-file ,(buffer-file-name))))

Example output in the CL repl:

(DEFUN F1 (ARG)
  (PRINT "long and complex computation…")
  (SLEEP 1)
  (F0 (DECF ARG)))
----------------------------------------------------------------------
It's bad style to reassign input parameters like ARG -- and often
useless.
----------------------------------------------------------------------
In general, FORMAT is used for most printing, because it's more
flexible.
----------------------------------------------------------------------

thanks to @Gavinok on Discord.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant