-
Notifications
You must be signed in to change notification settings - Fork 1
/
Eldev
64 lines (57 loc) · 2.23 KB
/
Eldev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
;;; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
(eldev-use-package-archive 'gnu)
(eldev-use-package-archive 'melpa)
(eldev-add-loading-roots 'test "test")
(eldev-add-extra-dependencies 'emacs 'json-mode)
(eldev-add-extra-dependencies 'eval 'json-mode)
(eldev-add-extra-dependencies 'test 'json-mode)
(setf eldev-standard-excludes
`(:or ,eldev-standard-excludes "./documents/"))
(setq-default package-lint-main-file "json-par.el")
(setq-default indent-tabs-mode nil)
(setq-default fill-column 80)
(setq-default tab-width 8)
(setq-default checkdoc-arguments-in-order-flag nil)
(defvar elisp-lint--url-in-document-regexp
(concat "^"
"[[:blank:]]*"
"\\(?:;+\\|\"\\)?"
"[[:blank:]]*"
"https?://"
"[][;,/?:@&=+$_.!~*'()#%[:alnum:]-]+"
"[[:blank:]]*\"?[[:blank:]]*"
"[[:blank:]]*)*[[:blank:]]*"
"$")
"This regexp must match a URL in comments or strings.")
(with-eval-after-load 'elisp-lint
;; Exempt URLs for column length limit.
(advice-add
#'elisp-lint--fill-column :override
;; Copied from elisp-lint.el and modified.
;; Copyright (C) 2013-2015 Nikolaj Schumacher
;; Copyright (C) 2018-2020 Neil Okamoto
;; GPL2+.
;; https://github.com/gonewest818/elisp-lint/
(lambda (&rest args)
(save-excursion
(let ((line-number 1)
(too-long-lines nil))
(goto-char (point-min))
(while (not (eobp))
(let ((text (buffer-substring-no-properties
(line-beginning-position)
(line-end-position))))
(when
(and (not
(string-match elisp-lint--package-summary-regexp text))
(not
(string-match elisp-lint--package-requires-regexp text))
(not
(string-match elisp-lint--url-in-document-regexp text))
(> (length text) fill-column))
(push (list line-number 0 'fill-column
(format "line length %s exceeded" fill-column))
too-long-lines)))
(setq line-number (1+ line-number))
(forward-line 1))
too-long-lines)))))