aboutsummaryrefslogtreecommitdiffstats
path: root/oni/home
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-04-07 15:00:44 -0700
committerGravatar Tom Willemse2025-04-09 15:33:59 -0700
commit854cb118ff22c9aec937b931d7c3f170e81329f4 (patch)
tree88cc02f282731955c98a9b7c82b40d7892e85b2f /oni/home
parent50b118b45ff58aa39e9cc8ea1a6d463fa44a44f9 (diff)
downloadnew-dotfiles-854cb118ff22c9aec937b931d7c3f170e81329f4.tar.gz
new-dotfiles-854cb118ff22c9aec937b931d7c3f170e81329f4.zip
pop-os: Fix filenames output by phpstan
Phpstan is running in a container where the paths are different. In order to help phpstan and Emacs understand eachother fix them up first.
Diffstat (limited to 'oni/home')
-rw-r--r--oni/home/config/pop-os/emacs.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/oni/home/config/pop-os/emacs.el b/oni/home/config/pop-os/emacs.el
index cff0bfa..75a7fc6 100644
--- a/oni/home/config/pop-os/emacs.el
+++ b/oni/home/config/pop-os/emacs.el
@@ -177,3 +177,17 @@ buffers.")
(setq browse-url-browser-function #'browse-url-generic)
(setq browse-url-generic-args '("run" "--branch=stable" "--arch=x86_64" "--command=launch-script.sh" "--file-forwarding" "app.zen_browser.zen"))
(setq browse-url-generic-program "/usr/bin/flatpak")
+
+(defun oni-fixup-phpstan-filenames (errors)
+ "Change the file name from each error in ERRORS to one on local disk."
+ (mapcar
+ (lambda (e)
+ (setf (flycheck-error-filename e)
+ (expand-file-name
+ (string-replace "/app/" "" (flycheck-error-filename e))
+ (project-root (project-current))))
+ e)
+ errors))
+
+(with-eval-after-load 'flycheck-phpstan
+ (advice-add 'flycheck-phpstan-parse-output :filter-return #'oni-fixup-phpstan-filenames))