-
-
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.
- Loading branch information
Showing
4 changed files
with
106 additions
and
4 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
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 = ['declare [files..]', 'lint-declare [files..]']; | ||
exports.desc = 'run declare'; | ||
exports.builder = { | ||
files: { | ||
description: 'files you want checkdoc to run on', | ||
requiresArg: false, | ||
type: 'array', | ||
}, | ||
}; | ||
|
||
exports.handler = async (argv) => { | ||
await UTIL.e_call(argv, 'lint/declare', 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
💡 You need to specify file(s) you want the check-declare to run | ||
|
||
$ eask declare FILE-1 FILE-2 | ||
|
||
💡 Or edit Eask file with [package-file] or [files] specifier | ||
|
||
[+] (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,51 @@ | ||
;;; declare.el --- Run declare -*- lexical-binding: t; -*- | ||
|
||
;;; Commentary: | ||
;; | ||
;; Commmand use to run `declare' for all files | ||
;; | ||
;; $ eask declare | ||
;; | ||
;; | ||
;; Initialization options: | ||
;; | ||
;; [files..] files you want checkdoc to run on | ||
;; | ||
|
||
;;; Code: | ||
|
||
(load (expand-file-name | ||
"../_prepare.el" | ||
(file-name-directory (nth 1 (member "-scriptload" command-line-args)))) | ||
nil t) | ||
|
||
(defun eask--check-declare-file (filename) | ||
"Run check-declare on FILENAME." | ||
(let* ((filename (expand-file-name filename)) | ||
(file (eask-root-del filename)) | ||
(errors)) | ||
(eask-msg "") | ||
(eask-msg "`%s` with check-declare" (ansi-green file)) | ||
(setq errors (check-declare-file filename)) | ||
(if errors | ||
(with-current-buffer check-declare-warning-buffer | ||
(eask-msg (buffer-string))) | ||
(eask-msg "No issues found")))) | ||
|
||
(eask-start | ||
(require 'check-declare) | ||
(if-let* ((files (if (eask-args) | ||
(eask-expand-file-specs (eask-args)) | ||
(eask-package-el-files))) | ||
(len (length files)) | ||
(s (eask--sinr len "" "s")) | ||
(have (eask--sinr len "has" "have"))) | ||
(progn | ||
(mapcar #'eask--check-declare-file files) | ||
(eask-info "(Total of %s file%s %s checked)" len s have)) | ||
(eask-info "(No files have been checked (declare))") | ||
(if (eask-args) | ||
(eask--print-no-matching-files) | ||
(eask-help 'declare)))) | ||
|
||
;;; declare.el ends here |