Skip to content

Commit

Permalink
[fu] batch-checkdoc - alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
pkryger committed Nov 18, 2024
1 parent 703547f commit 37539c8
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions .ci/batch-checkdoc.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,37 @@
(car command-line-args-left))
(process-default-directory default-directory))
(with-temp-buffer
(insert-file-contents source 'visit)
(setq buffer-file-name source)
(setq default-directory process-default-directory)
(with-demoted-errors "Error in checkdoc: %S"
(delay-mode-hooks
(emacs-lisp-mode))
(setq delayed-mode-hooks nil)
(checkdoc-current-buffer t)
(with-current-buffer checkdoc-diagnostic-buffer
;; When there are no errors, there are only a few lines in the
;; beginning of the buffer, followed by a single line
;; containing a `checkdoc' stamp. Remove them and see if
;; buffer has more lines than 1.
(let ((inhibit-read-only t))
(goto-char (point-min))
(when-let* (((looking-at
(rx string-start (group (zero-or-more (or whitespace "\n"))
(or "\n" line-end))))))
(delete-region (match-beginning 1) (match-end 1))))
(cl-incf number-of-errors (- (car (buffer-line-statistics))
1))
(princ
(buffer-substring-no-properties
(point-min)
(point-max)))
(princ "\n")
(kill-buffer)))))
(setq command-line-args-left (cdr command-line-args-left))))
(setq command-line-args-left nil)
(when (< 0 number-of-errors)
(error "There are %s checkdoc errors!" number-of-errors)))))
(insert-file-contents source 'visit)
(setq buffer-file-name source)
(setq default-directory process-default-directory)
(with-demoted-errors "Error in checkdoc: %S"
(delay-mode-hooks
(emacs-lisp-mode))
(setq delayed-mode-hooks nil)
(checkdoc-current-buffer t)
(with-current-buffer checkdoc-diagnostic-buffer
;; When there are no errors, there are only a few lines in the
;; beginning of the buffer, followed by a single line
;; containing a `checkdoc' stamp. Remove them and see if
;; buffer has more lines than 1.
(let ((inhibit-read-only t))
(goto-char (point-min))
(when-let* (((looking-at
(rx string-start (group (zero-or-more (or whitespace "\n"))
(or "\n" line-end))))))
(delete-region (match-beginning 1) (match-end 1))))
(cl-incf number-of-errors (- (car (buffer-line-statistics))
1))
(princ
(buffer-substring-no-properties
(point-min)
(point-max)))
(princ "\n")
(kill-buffer)))))
(setq command-line-args-left (cdr command-line-args-left))))
(setq command-line-args-left nil)
(when (< 0 number-of-errors)
(error "There are %s checkdoc errors!" number-of-errors)))))

(provide 'batch-checkdoc)
;;; batch-checkdoc.el ends here

0 comments on commit 37539c8

Please sign in to comment.