all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: emacs-devel@gnu.org
Subject: Re: Emacs Lisp Linter fail to identify function defined in a "use-package" block
Date: Tue, 07 Nov 2023 00:51:56 +0100	[thread overview]
Message-ID: <875y2efnj7.fsf@dataswamp.org> (raw)
In-Reply-To: 87pm11i0uj.fsf@dataswamp.org

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	other threads:[~2023-11-06 23:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12  0:32 Emacs Lisp Linter fail to identify function defined in a "use-package" block Kiong-Gē Liāu
2023-10-12  5:22 ` Emanuel Berg
2023-10-13  1:47   ` Emanuel Berg
2023-10-13  1:55   ` Emanuel Berg
2023-10-13  2:05   ` Emanuel Berg
2023-10-13  2:29   ` Emanuel Berg
2023-10-13  3:33   ` Emanuel Berg
2023-10-26 20:29     ` Emanuel Berg
2023-11-06 23:51       ` Emanuel Berg [this message]
2023-11-08  3:10         ` Richard Stallman
2023-11-08  8:56           ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2023-10-11 17:19 Kiong-Gē Liāu
2023-10-10 14:51 Kiong-Gē Liāu
2023-10-10 22:25 ` Emanuel Berg
2023-10-11  0:59 ` Emanuel Berg
2023-10-11  1:43 ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875y2efnj7.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.