feat: add and reword several elisp lints

This commit is contained in:
riscy 2020-09-13 10:11:39 -07:00
parent 961c310480
commit 3f020cce00

View file

@ -188,22 +188,31 @@ a Docker container, e.g. kellyk/emacs does not include the .el files."
(melpazoid-misc "lighter \"[^ \"]" "Lighter should start with a space")
(melpazoid-misc "lighter \".+ \"" "Lighter should start, but not end, with a space")
(melpazoid-misc "(fset" "Ensure this `fset` isn't being used as a surrogate `defalias`")
(melpazoid-misc "(fmakunbound" "`fmakunbound` should only _very rarely_ occur in packages")
(melpazoid-misc "(fmakunbound" "`fmakunbound` should rarely occur in packages")
(melpazoid-misc "^(progn" "`progn` is usually not required at the top level")
(melpazoid-misc "([^ ]*read-string \"[^\"]+[^ \"]\"" "Many `read-string` prompts should end with a space" t)
(melpazoid-misc ";;;###autoload\n(add-hook" "Don't autoload `add-hook`")
(melpazoid-misc ";; Package-Version" "Prefer `;; Version` over `;; Package-Version` (MELPA automatically adds `Package-Version`)")
(melpazoid-misc "([^ ]*read-string \"[^\"]+[^ \"]\"" "`read-string` prompts should often end with a space" t)
(melpazoid-misc ";;;###autoload\n(add-hook" "Loading a package should rarely add hooks" nil t)
(melpazoid-misc ";;;###autoload\n(advice-add" "Loading a package should rarely add advice" nil t)
(melpazoid-misc ";; Package-Version" "Prefer `;; Version` over `;; Package-Version` (MELPA automatically adds `Package-Version`)" nil t)
(melpazoid-misc "([<>eq/=]+ (point) (point-max))" "Could this point/point-max comparison use `eobp`?")
(melpazoid-misc "([<>eq/=]+ (point) (point-min))" "Could this point/point-min comparison use `bobp`?")
(melpazoid-misc "([<>eq/=]+ (point) (point-at-bol))" "Could this point/point-at-bol comparison use `bolp`?")
(melpazoid-misc "([<>eq/=]+ (point) (point-at-eol))" "Could this point/point-at-eol comparison use `eolp`?")
(melpazoid-misc "([<>eq/=]+ (point) (line-beginning-position))" "Could this point/point-at-bol comparison use `bolp`?")
(melpazoid-misc "([<>eq/=]+ (point) (line-end-position))" "Could this point/point-at-eol comparison use `eolp`?")
(melpazoid-misc "^(define-key" "Top-level `define-key` can overwrite user bindings. Try: `(defvar my-map (let ((km (make-sparse-keymap))) (define-key ...) km))`")
(melpazoid-misc "^(bind-keys" "Top-level bind-keys can overwrite user keybindings. Try: `(defvar my-map (let ((km (make-sparse-keymap))) (bind-keys ...) km))`")
(melpazoid-misc "(string-match[^(](symbol-name" "Prefer to use `eq` on symbols")
(melpazoid-misc "(defcustom [^ ]*--" "Customizable variables shouldn't be private")
(melpazoid-misc "(ignore-errors (progn" "No `progn` required under `ignore-errors`")
(melpazoid-misc "(ignore-errors (re-search-[fb]" "Use `re-search-*`'s NOERROR argument")
(melpazoid-misc "(ignore-errors (search-[fb]" "Use `search-*`'s NOERROR argument")
(melpazoid-misc "(error (format" "No `format` required; errors are already f-strings")
(melpazoid-misc "(user-error (format" "No `format` required; user-errors are already f-strings")
(melpazoid-misc "(message (format" "No `format` required; messages are already f-strings")
(melpazoid-misc "^ ;[^;]" "Single-line comments should usually begin with `;;`")
(melpazoid-misc "(unless (not " "Consider `when ...` instead of `unless (not ...)`")
(melpazoid-misc "(unless (null " "Consider `when ...` instead of `unless (null ...)`")
(melpazoid-misc "^ ;[^;]" "Single-line comments should usually begin with `;;`" nil t)
(melpazoid-misc "(unless (not " "Use `when ...` instead of `unless (not ...)`")
(melpazoid-misc "(unless (null " "Use `when ...` instead of `unless (null ...)`")
(melpazoid-misc "(when (not " "Consider `unless ...` instead of `when (not ...)`")
(melpazoid-misc "(when (null " "Consider `unless ...` instead of `when (null ...)`")
(melpazoid-misc "http://" "Prefer `https` over `http` if possible ([why?](https://news.ycombinator.com/item?id=22933774))" nil t)