File: Eldev

package info (click to toggle)
swift-mode 9.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: lisp: 13,883; sh: 59; makefile: 43
file content (68 lines) | stat: -rw-r--r-- 2,468 bytes parent folder | download
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
65
66
67
68
;;; -*- 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")

(setq elisp-lint-indent-specs
      '((swift-mode:with-temp-comment-buffer . 0)))

(setq-default package-lint-main-file "swift-mode.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)

(with-eval-after-load 'package-lint
  (advice-add #'package-lint--check-symbol-separators :override
              (lambda (&rest args)
                t))
  (advice-add #'package-lint--valid-definition-name-p :around
              (lambda (oldfun name prefix &rest args)
                (or (equal name "run-swift")
                    (apply oldfun name prefix args)))))

(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
  (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)))))