[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/relint 8e8db0e4b3 07/17: Simplify: xr-lint no longer si
From: |
ELPA Syncer |
Subject: |
[elpa] externals/relint 8e8db0e4b3 07/17: Simplify: xr-lint no longer signals errors |
Date: |
Thu, 1 Aug 2024 12:59:02 -0400 (EDT) |
branch: externals/relint
commit 8e8db0e4b3be7a7e232653bcfe7c4d8bb01cd31d
Author: Mattias EngdegÄrd <mattiase@acm.org>
Commit: Mattias EngdegÄrd <mattiase@acm.org>
Simplify: xr-lint no longer signals errors
---
relint.el | 62 +++++++++++++++++++++++++-------------------------------------
1 file changed, 25 insertions(+), 37 deletions(-)
diff --git a/relint.el b/relint.el
index 764e1841bb..82927d28f2 100644
--- a/relint.el
+++ b/relint.el
@@ -288,9 +288,6 @@ in case it occupies more than one position in the buffer."
(defun relint--err-at (pos message)
(relint--report message nil pos nil nil nil nil 'error))
-(defun relint--err (start-pos path message &optional str str-idx)
- (relint--report-at-path start-pos path message str str-idx nil 'error))
-
(defun relint--escape-string (str escape-printable)
(replace-regexp-in-string
;; Use pair notation for raw chars; "\200-\377" is buggy in Emacs 26.
@@ -332,45 +329,36 @@ in case it occupies more than one position in the buffer."
((pred stringp) name)
((pred symbolp) (symbol-name name))))
-(defun relint--check-string (string checker name pos path)
- (let ((complaints
- (condition-case err
- (funcall checker string)
- (error
- (relint--err pos path
- (format "In %s: %s"
- (relint--expand-name name) (cadr err))
- string nil)
- nil))))
- ;; FIXME: Compatibility hack: if given a list-of-lists, flatten it.
- ;; We should move to the list-of-lists repr for our purposes too,
- ;; to preserve diag clusters when sorting.
- (when (consp (car complaints))
- (setq complaints (mapcar #'car complaints)) ;HACK!
- ;;(setq complaints (apply #'append complaints))
- )
- (dolist (c complaints)
- (let* ((beg (nth 0 c))
- (end (nth 1 c))
- (msg (nth 2 c))
- (severity (nth 3 c)))
- (relint--report-at-path
- pos path (format "In %s: %s" (relint--expand-name name) msg)
- string beg end severity)))))
-
-(defun relint--check-skip-set (skip-set-string name pos path)
- (relint--check-string skip-set-string #'xr-skip-set-lint name pos path))
+(defun relint--message-with-name (msg name)
+ (format "In %s: %s" (relint--expand-name name) msg))
+
+(defun relint--check-string (complaints string name pos path)
+ ;; FIXME: Compatibility hack: if given a list-of-lists, flatten it.
+ ;; We should move to the list-of-lists repr for our purposes too,
+ ;; to preserve diag clusters when sorting.
+ (when (consp (car complaints))
+ (setq complaints (mapcar #'car complaints)) ;HACK!
+ ;;(setq complaints (apply #'append complaints))
+ )
+ (dolist (c complaints)
+ (let* ((beg (nth 0 c))
+ (end (nth 1 c))
+ (msg (nth 2 c))
+ (severity (nth 3 c)))
+ (relint--report-at-path pos path (relint--message-with-name msg name)
+ string beg end severity))))
+
+(defun relint--check-skip-set (skip-set name pos path)
+ (relint--check-string (xr-skip-set-lint skip-set) skip-set name pos path))
(defun relint--check-re-string (re name pos path)
- (relint--check-string re (lambda (x) (xr-lint x nil relint-xr-checks))
- name pos path))
+ (relint--check-string (xr-lint re nil relint-xr-checks) re name pos path))
(defun relint--check-file-re-string (re name pos path)
- (relint--check-string re (lambda (x) (xr-lint x 'file relint-xr-checks))
- name pos path))
+ (relint--check-string (xr-lint re 'file relint-xr-checks) re name pos path))
-(defun relint--check-syntax-string (syntax name pos path)
- (relint--check-string syntax #'relint--syntax-string-lint name pos path))
+(defun relint--check-syntax-string (syn name pos path)
+ (relint--check-string (relint--syntax-string-lint syn) syn name pos path))
(defconst relint--syntax-codes
'((?- . whitespace)
- [elpa] externals/relint 7abad19169 03/17: Adapt to xr changes: ranged diagnostics with severity field, (continued)
- [elpa] externals/relint 7abad19169 03/17: Adapt to xr changes: ranged diagnostics with severity field, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 61724881c3 10/17: Use a defstruct for diag objects instead of raw vectors, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 38c0468a05 17/17: Github CI: ignore changes to NEWS in actions, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 35a2bc31c8 11/17: Simplify: remove expr-pos from diag object, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 458a920b46 06/17: Use a vector instead of list for complaint tuple, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 79ba1f0183 14/17: Require Emacs 27 or newer, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 8cd09d69ae 16/17: NEWS entry for upcoming version 2.0, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 94b23171f0 12/17: Add pos-type field in diag object, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 5c63370936 04/17: Adapt to xr grouped diagnostics, ELPA Syncer, 2024/08/01
- [elpa] externals/relint caea432bb4 09/17: Better string range highlighting in output, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 8e8db0e4b3 07/17: Simplify: xr-lint no longer signals errors,
ELPA Syncer <=
- [elpa] externals/relint bc17dfcd16 05/17: Use ranges in relint's own diags, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 9495957270 08/17: Grouped diagnostics, handle 'info' messages, ELPA Syncer, 2024/08/01
- [elpa] externals/relint dfd0e30ac8 13/17: Expose the relint-diag object to the user, ELPA Syncer, 2024/08/01
- [elpa] externals/relint 61c0dd607f 15/17: Fix \x test in emacs 30, ELPA Syncer, 2024/08/01