emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs Lisp Linter fail to identify function defined in a "use-packag


From: Emanuel Berg
Subject: Re: Emacs Lisp Linter fail to identify function defined in a "use-package" block
Date: Tue, 07 Nov 2023 00:51:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

I have now tried another Elisp linter which I found on MELPA,
namely elisp-lint version 20220419.252 - you can get it here

  https://github.com/gonewest818/elisp-lint/

In the description, they say you can use it like this

  $(EMACS) -Q --batch -l elisp-lint.el -f elisp-lint-files-batch *.el

however that command does not include the full path of the
program, nor the paths of its dependencies, so it isn't quiet
that easy. But after putting together this mammoth command,
I got it to work

#! /bin/zsh
#
# this file:
#   https://dataswamp.org/~incal/conf/.zsh/emacs

elint () {
    local fs=($@)
    local elpa=~/.emacs.d/elpa
    local elint=${elpa}/elisp-lint-20220419.252/elisp-lint.el
    emacs -Q      \
          --batch \
          --eval "(push \"$elpa/compat-29.1.4.2\" load-path)"            \
          --eval "(push \"$elpa/dash-20230714.723\" load-path)"          \
          --eval "(push \"$elpa/package-lint-20231103.1810\" load-path)" \
          -l $elint                 \
          -f elisp-lint-files-batch \
          --no-byte-compile         \
          --no-check-declare        \
          --no-checkdoc             \
          --no-fill-column          \
          --no-indent               \
          --no-indent-character     \
          --no-package-lint         \
                                    $fs
}

--no-byte-compile - that would involve having to include even
more paths, and also, I already do byte-compile from another
command (in a Makefile) so I thought I'd get those warnings
from there anyway;

--no-check-declare - this remarks on the use of
`declare-function' to get away with byte-compiler warnings
from functions defined in lexical let-closures. I agree that
use shouldn't be necessary, but it is, so to not get the
warning from something put there to not get a warning,
I disabled it;

--no-checkdoc and --no-package-lint - those don't auto-detect
what files are packages and which are not, that is a pity;

and finally these three, which all have to do with
indentation, I disabled them since I don't consider those any
areas of meaningful improvements, really,

  --no-fill-column          
  --no-indent               
  --no-indent-character     

After doing all that, I'm not sure how many test remains!
But my Elisp came out on the other end with no warnings, so
I suppose it is good enough then.

Conclusion: This took some fiddling to get working but I think
it is a powerful program and I like that you can fine-tune it
to your needs in a very granular way.

PS. I CC this to the maintainers, let's hear what they have
    to say.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]