Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pkryger/ckeckdoc-batch.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checkdoc-batch.el - Run checkdoc in batch mode

Description

The checkdoc-batch Emacs package is designed to help running checkdoc in a batch mode. This is useful, for example to run it as one of linters in a CI pipeline.

Installation

If you’re using cask you can do something like

(development
 (depends-on "checkdoc-batch"
             :git "https://github.com/pkryger/ckeckdoc-batch.el.git"))

If you want to install the package into your current Emacs, you can use built-in use-package:

(use-package checkdoc-batch
  :defer t
  :vc (:url "https://github.com/pkryger/checkdoc-batch.el.git"
       :rev :newest)))

Usage

In a command line run something like:
emacs --batch \
      --load checkdoc-batch \
      --funcall checkdoc-batch \
      -- file1.el file2.el ... fileN.el

You can customize checkdoc-batch-ignored to ignore some files regardless if these are passed on command line. This can become handy, when for example you’re using cask and you want to relay on cask files.

Generate compile command from flycheck

Run this snippet in an org-mode buffer:

(require 'flycheck)
(when-let* ((flycheck-command (let (temp-file)
                                (unwind-protect
                                    (progn
                                      (setq temp-file
                                            (make-temp-file "checkdoc-batch"))
                                      (with-current-buffer
                                          (find-file-noselect temp-file)
                                        (emacs-lisp-mode)
                                        (flycheck-checker-shell-command
                                         'emacs-lisp-checkdoc)))
                                  (when temp-file
                                    (delete-file temp-file)))))
            (unescaped-command (replace-regexp-in-string
                                (rx "\\" (group any))
                                (rx (backref 1))
                                flycheck-command))
            (flycheck-script (replace-regexp-in-string
                              (rx (one-or-more any)
                                  " --eval " (group (one-or-more any))
                                  " -- " (one-or-more any))
                              "(quote \\1)"
                              unescaped-command)))
  (pp
   (eval (car (read-from-string flycheck-script)))))

Modify the output above to process multiple files and signal error when anything has been reported. See checkdoc-batch.el.

About

Run checkdoc on command line arguments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published