mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
@ -118,23 +118,24 @@ Each element of this list can be one of:
|
|||||||
(unless (equal scopes (sort (copy-sequence scopes) #'string-lessp))
|
(unless (equal scopes (sort (copy-sequence scopes) #'string-lessp))
|
||||||
(fail! "Scopes are not in lexicographical order")))
|
(fail! "Scopes are not in lexicographical order")))
|
||||||
|
|
||||||
(lambda! (&key type body)
|
(lambda! (&key _type body)
|
||||||
"Enforce 72 character line width for BODY"
|
"Enforce 72 character line width for BODY"
|
||||||
(catch 'result
|
(catch 'result
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(save-excursion (insert body))
|
(save-excursion (insert body))
|
||||||
(while (re-search-forward "^[^\n]\\{73,\\}" nil t)
|
(while (re-search-forward "^[^\n]\\{73,\\}" nil t)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(let ((bol (match-beginning 0)))
|
||||||
(or
|
(or
|
||||||
;; Long bump lines are acceptable
|
;; Long bump lines are acceptable
|
||||||
(let ((bump-re "\\(https?://.+\\|[^/]+\\)/[^/]+@[a-z0-9]\\{12\\}"))
|
(let ((bump-re "\\(https?://.+\\|[^/]+\\)/[^/]+@[a-z0-9]\\{12\\}"))
|
||||||
(re-search-backward (format "^%s -> %s$" bump-re bump-re) nil t))
|
(re-search-backward (format "^%s -> %s$" bump-re bump-re) bol t))
|
||||||
;; Long URLs are acceptable
|
;; Long URLs are acceptable
|
||||||
(re-search-backward "https?://[^ ]+\\{73,\\}" nil t)
|
(re-search-backward "https?://[^ \n]+" bol t)
|
||||||
;; Lines that start with # or whitespace are comment or
|
;; Lines that start with # or whitespace are comment or
|
||||||
;; code blocks.
|
;; code blocks.
|
||||||
(re-search-backward "^\\(?:#\\| +\\)" nil t)
|
(re-search-backward "^\\(?:#\\| +\\)" bol t)
|
||||||
(throw 'result (fail! "Line(s) in commit body exceed 72 characters"))))))))
|
(throw 'result (fail! "Line(s) in commit body exceed 72 characters")))))))))
|
||||||
|
|
||||||
(lambda! (&key bang body type)
|
(lambda! (&key bang body type)
|
||||||
"Ensure ! is accompanied by a 'BREAKING CHANGE:' in BODY"
|
"Ensure ! is accompanied by a 'BREAKING CHANGE:' in BODY"
|
||||||
|
Reference in New Issue
Block a user