[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phpinspect 8b6dc2eb38 1/8: Catch composer json format e
From: |
ELPA Syncer |
Subject: |
[elpa] externals/phpinspect 8b6dc2eb38 1/8: Catch composer json format errors and notify user |
Date: |
Mon, 14 Aug 2023 15:58:29 -0400 (EDT) |
branch: externals/phpinspect
commit 8b6dc2eb383848c52575b6ad9fd18cbb1f15a567
Author: Hugo Thunnissen <devel@hugot.nl>
Commit: Hugo Thunnissen <devel@hugot.nl>
Catch composer json format errors and notify user
---
phpinspect-autoload.el | 105 ++++++++++++++++++++++++++-----------------------
1 file changed, 56 insertions(+), 49 deletions(-)
diff --git a/phpinspect-autoload.el b/phpinspect-autoload.el
index 8533b89734..f0a2ceb6e8 100644
--- a/phpinspect-autoload.el
+++ b/phpinspect-autoload.el
@@ -177,55 +177,62 @@ bareword typenames."))
((al phpinspect-autoloader) file)
(let* ((fs (phpinspect-project-fs (phpinspect-autoloader-project al)))
(project-root (file-name-directory (cdr file)))
- (json (phpinspect--read-json-file fs (cdr file)))
- (autoload (gethash "autoload" json))
- batch)
- (when (hash-table-p autoload)
- (maphash
- (lambda (type prefixes)
- (let ((strategy))
- (pcase type
- ("psr-0"
- (maphash
- (lambda (prefix directory-paths)
- (when (stringp directory-paths)
- (setq directory-paths (list directory-paths)))
- (setq strategy (phpinspect-make-psr0-generated
- :autoloader al
- :fs fs
- :prefix prefix
- :own (eq 'local (car file))))
- (dolist (path directory-paths)
- (push (file-name-concat project-root path)
- (phpinspect-psr0-directories strategy)))
- (push strategy batch))
- prefixes))
- ("psr-4"
- (maphash
- (lambda (prefix directory-paths)
- (when (stringp directory-paths)
- (setq directory-paths (list directory-paths)))
- (setq strategy (phpinspect-make-psr4-generated
- :fs fs
- :autoloader al
- :prefix prefix
- :own (eq 'local (car file))))
- (dolist (path directory-paths)
- (push (file-name-concat project-root path)
- (phpinspect-psr4-directories strategy)))
- (push strategy batch))
- prefixes))
- ("files"
- (setq strategy
- (phpinspect-make-files
- :list (mapcar
- (lambda (file) (file-name-concat project-root
file))
- prefixes)
- :autoloader al))
- (push strategy batch))
- (_ (phpinspect--log "Unsupported autoload strategy \"%s\"
encountered" type)))))
- autoload)
- (phpinspect-pipeline-emit-all batch))))
+ json autoload batch)
+
+
+ (condition-case err
+ (setq json (phpinspect--read-json-file fs (cdr file)))
+ (t (message "Error parsing composer json at %s : %s " (cdr file) err)))
+
+ (when json
+ (setq autoload (gethash "autoload" json))
+
+ (when (hash-table-p autoload)
+ (maphash
+ (lambda (type prefixes)
+ (let ((strategy))
+ (pcase type
+ ("psr-0"
+ (maphash
+ (lambda (prefix directory-paths)
+ (when (stringp directory-paths)
+ (setq directory-paths (list directory-paths)))
+ (setq strategy (phpinspect-make-psr0-generated
+ :autoloader al
+ :fs fs
+ :prefix prefix
+ :own (eq 'local (car file))))
+ (dolist (path directory-paths)
+ (push (file-name-concat project-root path)
+ (phpinspect-psr0-directories strategy)))
+ (push strategy batch))
+ prefixes))
+ ("psr-4"
+ (maphash
+ (lambda (prefix directory-paths)
+ (when (stringp directory-paths)
+ (setq directory-paths (list directory-paths)))
+ (setq strategy (phpinspect-make-psr4-generated
+ :fs fs
+ :autoloader al
+ :prefix prefix
+ :own (eq 'local (car file))))
+ (dolist (path directory-paths)
+ (push (file-name-concat project-root path)
+ (phpinspect-psr4-directories strategy)))
+ (push strategy batch))
+ prefixes))
+ ("files"
+ (setq strategy
+ (phpinspect-make-files
+ :list (mapcar
+ (lambda (file) (file-name-concat project-root
file))
+ prefixes)
+ :autoloader al))
+ (push strategy batch))
+ (_ (phpinspect--log "Unsupported autoload strategy \"%s\"
encountered" type)))))
+ autoload)
+ (phpinspect-pipeline-emit-all batch)))))
(cl-defmethod phpinspect-autoloader-resolve ((autoloader phpinspect-autoloader)
- [elpa] externals/phpinspect updated (7c76cbcc54 -> f1e4a5be7d), ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 8b6dc2eb38 1/8: Catch composer json format errors and notify user,
ELPA Syncer <=
- [elpa] externals/phpinspect 71531b7996 5/8: Define free variables + use condition-case-unless-debug, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect f1e4a5be7d 8/8: Remove debug statement for company backend, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 6e5e2e3a07 3/8: Exclude comments from eldoc statement, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 2ff9919e44 4/8: Add debug statements + use condition-case-unless-debug for token indexation, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect 633b08809e 2/8: Only retrieve/update class when a name has been declared for it, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect f6cc199886 7/8: When debugging, forward worker errors to main thread, ELPA Syncer, 2023/08/14
- [elpa] externals/phpinspect f9f12590e8 6/8: Handle cases where declarations do not contain a name, ELPA Syncer, 2023/08/14