Skip to content

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

Description

@vindarel

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions