-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add command for elisp-lint (#79)
* feat: Add command for elisp-lint * Update todo list * Provide better error result * Add help for regexps command * Add missing help elint * update test * Add doc * changelog * Add package metadata * clean up doc
- Loading branch information
Showing
41 changed files
with
191 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright (C) 2022 Jen-Chieh Shen | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3, or (at your option) | ||
* any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with GNU Emacs; see the file COPYING. If not, write to the | ||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
* Boston, MA 02110-1301, USA. | ||
*/ | ||
|
||
"use strict"; | ||
|
||
exports.command = ['elisp-lint [files..]']; | ||
exports.desc = 'run elisp-lint'; | ||
exports.builder = { | ||
files: { | ||
description: 'files you want elisp-lint to run on', | ||
requiresArg: false, | ||
type: 'array', | ||
}, | ||
}; | ||
|
||
exports.handler = async (argv) => { | ||
await UTIL.e_call(argv, 'lint/elisp-lint', argv.files); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
💡 You need to specify file(s) you want the elint to run | ||
|
||
[+] (package-file "ENTRY") ; One argument with a string | ||
[+] (files "FILE-1" "FILE-2" ...) ; All arguments are wildcard patterns | ||
|
||
For example, | ||
|
||
[+] (files "*.el") | ||
|
||
💡 Tip: You can use the command [files] to show all selected files | ||
|
||
$ eask files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
💡 You need to specify file(s) you want the elisp-lint to run | ||
|
||
[+] (package-file "ENTRY") ; One argument with a string | ||
[+] (files "FILE-1" "FILE-2" ...) ; All arguments are wildcard patterns | ||
|
||
For example, | ||
|
||
[+] (files "*.el") | ||
|
||
💡 Tip: You can use the command [files] to show all selected files | ||
|
||
$ eask files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
💡 You need to specify file(s) you want the elsa to run | ||
|
||
[+] (package-file "ENTRY") ; One argument with a string | ||
[+] (files "FILE-1" "FILE-2" ...) ; All arguments are wildcard patterns | ||
|
||
For example, | ||
|
||
[+] (files "*.el") | ||
|
||
💡 Tip: You can use the command [files] to show all selected files | ||
|
||
$ eask files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
💡 You need to specify file(s) you want the relint to run | ||
|
||
[+] (package-file "ENTRY") ; One argument with a string | ||
[+] (files "FILE-1" "FILE-2" ...) ; All arguments are wildcard patterns | ||
|
||
For example, | ||
|
||
[+] (files "*.el") | ||
|
||
💡 Tip: You can use the command [files] to show all selected files | ||
|
||
$ eask files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
;;; lint/elisp-lint.el --- Run elisp-lint -*- lexical-binding: t; -*- | ||
|
||
;;; Commentary: | ||
;; | ||
;; Commmand use to run `elisp-lint' for all files | ||
;; | ||
;; $ eask lint elisp-lint [files..] | ||
;; | ||
;; | ||
;; Initialization options: | ||
;; | ||
;; [files..] files you want elisp-lint to run on | ||
;; | ||
|
||
;;; Code: | ||
|
||
(load (expand-file-name | ||
"../_prepare.el" | ||
(file-name-directory (nth 1 (member "-scriptload" command-line-args)))) | ||
nil t) | ||
|
||
(defconst eask--elisp-lint-version nil | ||
"`elisp-lint' version.") | ||
|
||
(defun eask--elisp-lint-process-file (filename) | ||
"Process FILENAME." | ||
(let* ((filename (expand-file-name filename)) | ||
(file (eask-root-del filename)) | ||
success) | ||
(eask-msg "") | ||
(eask-msg "`%s` with elisp-lint (%s)" (ansi-green file) eask--elisp-lint-version) | ||
(eask-with-verbosity 'debug | ||
(setq success (elisp-lint-file filename))) | ||
;; Report result! | ||
(cond (success | ||
(eask-msg "No issues found")) | ||
((eask-strict-p) | ||
(eask-error "Linting failed"))))) | ||
|
||
(eask-start | ||
(eask-with-archives "melpa" | ||
(eask-package-install 'elisp-lint)) | ||
(setq eask--elisp-lint-version (eask-package--version-string 'elisp-lint)) | ||
(require 'elisp-lint) | ||
(if-let ((files (eask-args-or-package-el-files))) | ||
(progn | ||
(mapcar #'eask--elisp-lint-process-file files) | ||
(eask-info "(Total of %s files linted)" (length files))) | ||
(eask-info "(No files have been linted)") | ||
(if (eask-args) | ||
(eask--print-no-matching-files) | ||
(eask-help "lint/elisp-lint")))) | ||
|
||
;;; lint/elisp-lint.el ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.