purcell / package-lint

A linting library for elisp package metadata
GNU General Public License v3.0
193 stars 34 forks source link

Wrong type argument, `listp` if `defalias`, ... are mapped in an alist #196

Open nbfalcon opened 3 years ago

nbfalcon commented 3 years ago

To reproduce:

  1. Open an Elisp file containing a cons like (defalias . 5) (as can be found in various alists of lispy):
    '(defalias . 2)
  2. M-x package-lint-current-buffer
  3. Observe wrong-type-argument listp.

The cause of the issue is as follows: package-lint--check-objects-by-regexp finds s-expressions beginning with defalias, that are in fact conses. Many checker functions passed to it then take the cadr, which fails, since the cdr isn't a list.

I have fixed this locally and will make a PR shortly.