Run relint and fix detected regexp issues
ci/woodpecker/push/woodpecker Pipeline failed Details

WIP-cache
Hugo Thunnissen 9 months ago
parent ad4b1f25a6
commit 8cfc48348f

@ -102,7 +102,7 @@ bareword typenames."))
(inline-quote
(phpinspect-intern-name
(replace-regexp-in-string
"[\\\\]+"
"\\\\[\\]+"
"\\\\"
(concat "\\"
(or ,prefix "")

@ -430,10 +430,10 @@ linked with."
;; Take into account "atoms" (tokens without clear delimiters like words,
;; variables and object attributes. The meaning of these tokens will change as
;; they grow or shrink, so their ful regions need to be marked for a reparse).
;; they grow or shrink, so their full regions need to be marked for a reparse).
(save-excursion
(goto-char start)
(when (looking-back "\\($|->|::\\)?[^][)(}{[:blank:]\n;'\"]+" nil t)
(when (looking-back "\\(\\$\\|->\\|::\\)?[^][)(}{[:blank:]\n;'\"]+" nil t)
(setq start (- start (length (match-string 0))))
(setq pre-change-length (+ pre-change-length (length (match-string 0))))))

@ -107,7 +107,7 @@ buffer position to insert the use statement at."
(t (message "No import found for type %s" typename))))))
(defun phpinspect-namespace-part-of-typename (typename)
(string-trim-right typename "\\\\?[^\\\\]+"))
(string-trim-right typename "\\\\?[^\\]+"))
(defalias 'phpinspect-fix-uses-interactive #'phpinspect-fix-imports
"Alias for backwards compatibility")

@ -314,7 +314,7 @@ class Thing
function doStuff()
{
$this->getThis(new \DateTime(), bla)")
$this->getThis(new \\DateTime(), bla)")
(tokens (phpinspect-parse-string php-code))
(index (phpinspect--index-tokens tokens))
(phpinspect-project-root-function (lambda () "phpinspect-test"))

@ -28,6 +28,12 @@
(require 'phpinspect-fs)
(require 'phpinspect-autoload)
(ert-deftest phpinspect-filename-to-typename ()
(should (eq (phpinspect-intern-name "\\Foo\\Bar") (phpinspect-filename-to-typename "src/" "src/Foo////////Bar.php")))
(should (eq (phpinspect-intern-name "\\Foo\\Bar") (phpinspect-filename-to-typename "src/somewhere/else/" "src/somewhere/else/Foo/Bar.php"))))
(ert-deftest phpinspect-find-composer-json-files ()
(let* ((fs (phpinspect-make-virtual-fs))
(autoloader (phpinspect-make-autoloader

@ -8,7 +8,7 @@
buffer-file-name)))
(print-length 1000)
(print-level 1000))
(dolist (file (directory-files (concat here "/../fixtures" ) t "\\.php$"))
(dolist (file (directory-files (concat here "/../fixtures" ) t "\\.php\\'"))
(with-temp-buffer
(insert-file-contents-literally file)
(let ((result (phpinspect-parse-current-buffer)))

Loading…
Cancel
Save