From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: Re: Emacs Lisp Linter fail to identify function defined in a "use-package" block Date: Tue, 07 Nov 2023 00:51:56 +0100 Message-ID: <875y2efnj7.fsf@dataswamp.org> References: <87il7c8le4.fsf@dataswamp.org> <87lec76vsw.fsf@dataswamp.org> <87pm11i0uj.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1593"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:ugEojTyiEg5xoNsBIHU0lccjh/I= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 07 04:22:17 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r0CfR-0000Do-G3 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Nov 2023 04:22:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0Cf2-0004WM-RH; Mon, 06 Nov 2023 22:21:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r09OA-0002FB-5P for emacs-devel@gnu.org; Mon, 06 Nov 2023 18:52:14 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r09O8-0001aR-6K for emacs-devel@gnu.org; Mon, 06 Nov 2023 18:52:13 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1r09O5-0004Do-EZ for emacs-devel@gnu.org; Tue, 07 Nov 2023 00:52:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 06 Nov 2023 22:21:51 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312282 Archived-At: 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