branch: elpa/flymake-collection commit e1a001ba85d8b2510a674f6412aa48ab9402e221 Author: Mohsin Kaleem <mohk...@kisara.moe> Commit: Mohsin Kaleem <mohk...@kisara.moe>
(flymake-rest): Cleanup package-lint and other issues + Ran through all the files with package-lint. + Fixed any pertinent byte-compile warnings. --- .gitignore | 1 + checkers/flymake-rest-awk-gawk.el | 2 ++ checkers/flymake-rest-clang.el | 2 ++ checkers/flymake-rest-eslint.el | 2 ++ checkers/flymake-rest-gcc.el | 10 ++++++++-- checkers/flymake-rest-html-tidy.el | 2 ++ checkers/flymake-rest-jq.el | 2 ++ checkers/flymake-rest-jsonlint.el | 2 ++ checkers/flymake-rest-less.el | 2 ++ checkers/flymake-rest-markdownlint.el | 5 ++++- checkers/flymake-rest-mypy.el | 2 ++ checkers/flymake-rest-proselint.el | 22 ++++++++++++---------- checkers/flymake-rest-pycodestyle.el | 2 ++ checkers/flymake-rest-pylint.el | 2 ++ checkers/flymake-rest-rubocop.el | 6 +++++- checkers/flymake-rest-shellcheck.el | 2 ++ checkers/flymake-rest-xmllint.el | 2 ++ checkers/flymake-rest-yamllint.el | 2 ++ flymake-rest-commands.el | 8 +++++--- flymake-rest-define.el | 9 ++++++--- flymake-rest-hook-use-package.el | 2 ++ flymake-rest-hook.el | 17 +++++++++++------ flymake-rest-parse-enumerate.el | 4 +++- flymake-rest-parse-rx.el | 2 ++ flymake-rest.el | 11 +++++++---- 25 files changed, 92 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..c531d9867f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.elc diff --git a/checkers/flymake-rest-awk-gawk.el b/checkers/flymake-rest-awk-gawk.el index 239a70585d..d1b6a694ab 100644 --- a/checkers/flymake-rest-awk-gawk.el +++ b/checkers/flymake-rest-awk-gawk.el @@ -49,3 +49,5 @@ (warning bol (? "g") "awk: -:" line ": " "warning" ": " (message) eol)))) (provide 'flymake-rest-awk-gawk) + +;;; flymake-rest-awk-gawk.el ends here diff --git a/checkers/flymake-rest-clang.el b/checkers/flymake-rest-clang.el index 40a1568a83..304985b702 100644 --- a/checkers/flymake-rest-clang.el +++ b/checkers/flymake-rest-clang.el @@ -68,3 +68,5 @@ See URL `http://clang.llvm.org/'." (note bol "<stdin>:" line ":" column ": " "note" ": " (message) eol)))) (provide 'flymake-rest-gcc) + +;;; flymake-rest-clang.el ends here diff --git a/checkers/flymake-rest-eslint.el b/checkers/flymake-rest-eslint.el index d37ea6d9dd..12eeb58c78 100644 --- a/checkers/flymake-rest-eslint.el +++ b/checkers/flymake-rest-eslint.el @@ -66,3 +66,5 @@ See URL `https://eslint.org/'." (concat "[" .ruleId "] " .message)))))) (provide 'flymake-rest-eslint) + +;;; flymake-rest-eslint.el ends here diff --git a/checkers/flymake-rest-gcc.el b/checkers/flymake-rest-gcc.el index d7d2a3caaa..783bb9e26b 100644 --- a/checkers/flymake-rest-gcc.el +++ b/checkers/flymake-rest-gcc.el @@ -30,10 +30,14 @@ (defcustom flymake-rest-gcc-args '("-pedantic" "-pedantic-errors") - "Command line arguments always passed to `flymake-rest-gcc'.") + "Command line arguments always passed to `flymake-rest-gcc'." + :type 'list + :group 'flymake-rest) (defcustom flymake-rest-gcc-include-path nil - "Default include path for gcc in `flymake-rest-gcc'.") + "Default include path for gcc in `flymake-rest-gcc'." + :type 'list + :group 'flymake-rest) ;;;###autoload (autoload 'flymake-rest-gcc "flymake-rest-gcc") (flymake-rest-define flymake-rest-gcc @@ -68,3 +72,5 @@ Requires GCC 4.4 or newer. See URL `https://gcc.gnu.org/'." (note bol "<stdin>:" line ":" column ": " "note" ": " (message) eol)))) (provide 'flymake-rest-gcc) + +;;; flymake-rest-gcc.el ends here diff --git a/checkers/flymake-rest-html-tidy.el b/checkers/flymake-rest-html-tidy.el index 83e83f1226..6481998a42 100644 --- a/checkers/flymake-rest-html-tidy.el +++ b/checkers/flymake-rest-html-tidy.el @@ -46,3 +46,5 @@ See URL `https://github.com/htacg/tidy-html5'." (warning bol "line " line " column " column " - Warning: " (message) eol)))) (provide 'flymake-rest-html-tidy) + +;;; flymake-rest-html-tidy.el ends here diff --git a/checkers/flymake-rest-jq.el b/checkers/flymake-rest-jq.el index 53c05e492e..3e33cc4e6b 100644 --- a/checkers/flymake-rest-jq.el +++ b/checkers/flymake-rest-jq.el @@ -49,3 +49,5 @@ See URL `https://stedolan.github.io/jq/'." (provide 'flymake-rest-jq) + +;;; flymake-rest-jq.el ends here diff --git a/checkers/flymake-rest-jsonlint.el b/checkers/flymake-rest-jsonlint.el index 746a0569a5..7bba61fd7c 100644 --- a/checkers/flymake-rest-jsonlint.el +++ b/checkers/flymake-rest-jsonlint.el @@ -46,3 +46,5 @@ See URL `https://github.com/zaach/jsonlint'." (provide 'flymake-rest-jsonlint) + +;;; flymake-rest-jsonlint.el ends here diff --git a/checkers/flymake-rest-less.el b/checkers/flymake-rest-less.el index 76e86352ad..7ad0fa2377 100644 --- a/checkers/flymake-rest-less.el +++ b/checkers/flymake-rest-less.el @@ -48,3 +48,5 @@ See URL `http://lesscss.org'." (provide 'flymake-rest-less) + +;;; flymake-rest-less.el ends here diff --git a/checkers/flymake-rest-markdownlint.el b/checkers/flymake-rest-markdownlint.el index 2dff002769..16ca58f893 100644 --- a/checkers/flymake-rest-markdownlint.el +++ b/checkers/flymake-rest-markdownlint.el @@ -31,7 +31,8 @@ (defcustom flymake-rest-markdownlint-style nil "Path to the style config for markdownlint." - :type 'string) + :type 'string + :group 'flymake-rest) ;;;###autoload (autoload 'flymake-rest-markdownlint "flymake-rest-markdownlint") (flymake-rest-define flymake-rest-markdownlint @@ -51,3 +52,5 @@ See URL `https://github.com/markdownlint/markdownlint'." ((error bol "(stdin):" line ": " (id "MD" (+ digit)) " " (message) eol)))) (provide 'flymake-rest-markdownlint) + +;;; flymake-rest-markdownlint.el ends here diff --git a/checkers/flymake-rest-mypy.el b/checkers/flymake-rest-mypy.el index 77db28558d..7131b20523 100644 --- a/checkers/flymake-rest-mypy.el +++ b/checkers/flymake-rest-mypy.el @@ -54,3 +54,5 @@ See URL `http://mypy-lang.org/'." (note bol (file-name) ":" line ":" column ": note: " (message) eol)))) (provide 'flymake-rest-mypy) + +;;; flymake-rest-mypy.el ends here diff --git a/checkers/flymake-rest-proselint.el b/checkers/flymake-rest-proselint.el index 0918054955..c5f4f771f5 100644 --- a/checkers/flymake-rest-proselint.el +++ b/checkers/flymake-rest-proselint.el @@ -49,15 +49,17 @@ See URL `http://proselint.com/'." (buffer-substring-no-properties (point-min) (point-max)))))) (let-alist it - (let ((loc (cons (car (flymake-diag-region fmqd-source .line .column)) - (cdr (flymake-diag-region fmqd-source .endLine .endColumn))))) - (list fmqd-source - .start - .end - (pcase .severity - ("suggestion" :note) - ("warning" :warning) - ((or "error" _) :error)) - (concat (propertize .check 'face 'flymake-rest-diag-id) " " .message)))))) + ;; (cons (car (flymake-diag-region fmqd-source .line .column)) + ;; (cdr (flymake-diag-region fmqd-source .endLine .endColumn))) + (list fmqd-source + .start + .end + (pcase .severity + ("suggestion" :note) + ("warning" :warning) + ((or "error" _) :error)) + (concat (propertize .check 'face 'flymake-rest-diag-id) " " .message))))) (provide 'flymake-rest-proselint) + +;;; flymake-rest-proselint.el ends here diff --git a/checkers/flymake-rest-pycodestyle.el b/checkers/flymake-rest-pycodestyle.el index ce918039cb..972d4a4643 100644 --- a/checkers/flymake-rest-pycodestyle.el +++ b/checkers/flymake-rest-pycodestyle.el @@ -44,3 +44,5 @@ ((error bol (file-name) ":" line ":" column ": " (id (or "E" "W") (one-or-more digit)) " " (message) eol)))) (provide 'flymake-rest-pycodestyle) + +;;; flymake-rest-pycodestyle.el ends here diff --git a/checkers/flymake-rest-pylint.el b/checkers/flymake-rest-pylint.el index 63e6ce7cba..7f291e2a6a 100644 --- a/checkers/flymake-rest-pylint.el +++ b/checkers/flymake-rest-pylint.el @@ -66,3 +66,5 @@ (concat (propertize .message-id 'face 'flymake-rest-diag-id) " " .message)))))) (provide 'flymake-rest-pylint) + +;;; flymake-rest-pylint.el ends here diff --git a/checkers/flymake-rest-rubocop.el b/checkers/flymake-rest-rubocop.el index cb3643c42b..9a1c22e9f2 100644 --- a/checkers/flymake-rest-rubocop.el +++ b/checkers/flymake-rest-rubocop.el @@ -30,7 +30,9 @@ (require 'flymake-rest-parse-rx)) (defcustom flymake-rest-rubocop-use-bundler t - :type 'boolean) + "When true use bundle exec for rubocop checks." + :type 'boolean + :group 'flymake-rest) ;;;###autoload (autoload 'flymake-rest-rubocop "flymake-rest-rubocop") (flymake-rest-define flymake-rest-rubocop @@ -69,3 +71,5 @@ See URL `https://github.com/rubocop/rubocop'." (note bol (file-name) ":" line ":" column ": " "W" ": " (? "[Correctable] ") (message) eol)))) (provide 'flymake-rest-rubocop) + +;;; flymake-rest-rubocop.el ends here diff --git a/checkers/flymake-rest-shellcheck.el b/checkers/flymake-rest-shellcheck.el index 6f57811d86..7bb2cf6c7d 100644 --- a/checkers/flymake-rest-shellcheck.el +++ b/checkers/flymake-rest-shellcheck.el @@ -64,3 +64,5 @@ See URL `https://github.com/koalaman/shellcheck/'." (concat (propertize (format "SC%s" .code) 'face 'flymake-rest-diag-id) " " .message)))))) (provide 'flymake-rest-shellcheck) + +;;; flymake-rest-shellcheck.el ends here diff --git a/checkers/flymake-rest-xmllint.el b/checkers/flymake-rest-xmllint.el index dabda0b0e2..5d54fb8503 100644 --- a/checkers/flymake-rest-xmllint.el +++ b/checkers/flymake-rest-xmllint.el @@ -48,3 +48,5 @@ The xmllint is part of libxml2, see URL (provide 'flymake-rest-xmllint) ;;; flymake-rest-xml.el ends here + +;;; flymake-rest-xmllint.el ends here diff --git a/checkers/flymake-rest-yamllint.el b/checkers/flymake-rest-yamllint.el index aa8e1a69d6..4e091f026c 100644 --- a/checkers/flymake-rest-yamllint.el +++ b/checkers/flymake-rest-yamllint.el @@ -44,3 +44,5 @@ See URL `https://github.com/adrienverge/yamllint'." (warning bol "stdin:" line ":" column ": " "[warning] " (message) eol)))) (provide 'flymake-rest-yamllint) + +;;; flymake-rest-yamllint.el ends here diff --git a/flymake-rest-commands.el b/flymake-rest-commands.el index ad622e36c5..22750289c9 100644 --- a/flymake-rest-commands.el +++ b/flymake-rest-commands.el @@ -27,11 +27,11 @@ ;;;###autoload (defun flymake-rest-change-checker (&optional arg) - "Interactively select and enable/disable checker for the current major-mode. -With ARG select a checker regardless of major-mode." + "Interactively select and enable/disable checker for the current `major-mode'. +With ARG select a checker regardless of `major-mode'." (interactive "P") (let ((cands - (remove-duplicates + (cl-remove-duplicates (cl-loop for (mode . checkers) in (if arg flymake-rest-config @@ -88,3 +88,5 @@ With ARG select a checker regardless of major-mode." (flymake-start)))) (provide 'flymake-rest-commands) + +;;; flymake-rest-commands.el ends here diff --git a/flymake-rest-define.el b/flymake-rest-define.el index a604571a43..3f6d2ddc01 100644 --- a/flymake-rest-define.el +++ b/flymake-rest-define.el @@ -38,7 +38,8 @@ (defmacro flymake-rest-define (name &optional docstring &rest defs) "Quickly define a backend for use with Flymake. This macro creates a new function NAME which is suitable for use with the -variable `flymake-diagnostic-functions'. +variable `flymake-diagnostic-functions'. DOCSTRING if given will become the +docstring of the checker function. DEFS is a plist of values used to setup the backend. The only required fields in DEFS is :command and :error-parser. @@ -67,7 +68,7 @@ suffix the messages for each diagnostic. :write-type specifies how the process for flymake should recieve the input. It should be one of 'pipe or 'file (defaulting to 'pipe). When set to file -a temporary file will be created copying the contents of the current-buffer. +a temporary file will be created copying the contents of the `current-buffer'. The variable fmqd-temp-file and fmqd-temp-dir will be bound in the body of the rest of the keywords that provide access to the temp-file. When set to pipe after the process has been started all of the current buffers input @@ -80,7 +81,7 @@ will be set to a folder in the systems temporary directory. :pre-let is a `let*' form that is assigned after any backend-agnostic let forms have been setup. -:pre-check is a lisp form that will be executed immeadiately before any pending +:pre-check is a Lisp form that will be executed immeadiately before any pending checker processes are killed and a new process is begun. It can check conditions to ensure launching the checker program is possible. If something is wrong it should signal an error. @@ -240,3 +241,5 @@ diagnostics to parse this form should evaluate to nil." ,proc-symb)))))) (provide 'flymake-rest-define) + +;;; flymake-rest-define.el ends here diff --git a/flymake-rest-hook-use-package.el b/flymake-rest-hook-use-package.el index f5fcc447a9..abf5feead7 100644 --- a/flymake-rest-hook-use-package.el +++ b/flymake-rest-hook-use-package.el @@ -47,3 +47,5 @@ body))) (provide 'flymake-rest-hook-use-package) + +;;; flymake-rest-hook-use-package.el ends here diff --git a/flymake-rest-hook.el b/flymake-rest-hook.el index 3f282ed6bf..41f188ec42 100644 --- a/flymake-rest-hook.el +++ b/flymake-rest-hook.el @@ -25,17 +25,21 @@ ;;; Code: +(require 'cl-lib) + ;;;###autoload (defcustom flymake-rest-config nil "Configuration mapping major-modes to flymake-backends." - :type 'list) + :type 'list + :group 'flymake-rest) (defcustom flymake-rest-config-inherit nil - "When true any configured checkers for a parent major-mode are -also added to `flymake-diagnostic-functions'." - :type 'boolean) + "When true diagnostic hooks inherit parent-mode hooks." + :type 'boolean + :group 'flymake-rest) (defun flymake-rest-configured-checkers (mode) + "Fetch the list of diagnostic functions configured for MODE." (let (checkers (modes (list mode))) ;; Consider all the parent modes as well. @@ -61,8 +65,7 @@ also added to `flymake-diagnostic-functions'." (nreverse checkers))) (defun flymake-rest-hook-set-backends () - "Function to add all the diagnostic for the current-major mode -from `flymake-rest-config' to `flymake-diagnostic-functions'." + "Setup `flymake-diagnostic-functions' using `flymake-rest-config'." (dolist (it (flymake-rest-configured-checkers major-mode)) (add-hook 'flymake-diagnostic-functions (car it) (cdr it) t))) @@ -76,3 +79,5 @@ from `flymake-rest-config' to `flymake-diagnostic-functions'." (remove-hook 'after-change-major-mode-hook #'flymake-rest-hook-set-backends)) (provide 'flymake-rest-hook) + +;;; flymake-rest-hook.el ends here diff --git a/flymake-rest-parse-enumerate.el b/flymake-rest-parse-enumerate.el index 0d4a0dc751..9581428c9c 100644 --- a/flymake-rest-parse-enumerate.el +++ b/flymake-rest-parse-enumerate.el @@ -31,7 +31,7 @@ ;;;###autoload (defmacro flymake-rest-parse-enumerate (gen &rest body) "Error parser for `flymake-backend-define' which parses all of -the diagnostics at once using GEN and then preparing them one-at-a-time +the diagnostics at once using GEN and then prepares them one-at-a-time with BODY. The value of the current entry from GEN in BODY will be set to the variable @@ -52,3 +52,5 @@ The value of the current entry from GEN in BODY will be set to the variable res)))) (provide 'flymake-rest-parse-enumerate) + +;;; flymake-rest-parse-enumerate.el ends here diff --git a/flymake-rest-parse-rx.el b/flymake-rest-parse-rx.el index f2221065d0..aabc1e49d7 100644 --- a/flymake-rest-parse-rx.el +++ b/flymake-rest-parse-rx.el @@ -155,3 +155,5 @@ For an example of this macro in action, see `flymake-rest-pycodestyle'." res))) (provide 'flymake-rest-parse-rx) + +;;; flymake-rest-parse-rx.el ends here diff --git a/flymake-rest.el b/flymake-rest.el index 041ca57ca5..7dc1128dc3 100644 --- a/flymake-rest.el +++ b/flymake-rest.el @@ -6,7 +6,7 @@ ;; Created: 15 June 2021 ;; Homepage: https://github.com/mohkale/flymake-rest ;; Keywords: language tools -;; Package-Requires: ((emacs "26.1") (flymake "1")) +;; Package-Requires: ((emacs "27.1")) ;; SPDX-License-Identifier: MIT ;; Version: 1.0.0 @@ -43,10 +43,11 @@ ;;; Code: (defgroup flymake-rest nil - "Flymake flycheck compatibility" - :prefix "flymake-rest") + "Flymake flycheck compatibility." + :prefix "flymake-rest" + :group 'flymake) -(defgroup consult-faces nil +(defgroup flymake-rest-faces nil "Faces used by flymake-rest." :group 'flymake-rest :group 'faces) @@ -80,3 +81,5 @@ like output from OUTPUT into a list and then returns it." objects)) (provide 'flymake-rest) + +;;; flymake-rest.el ends here