Skip to content

Explicitly set the custom variable to :local t #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flymake-phpstan.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
(require 'cl-lib)
(require 'php-project)
(require 'flymake)
(require 'flymake-proc)
(require 'phpstan)
(eval-when-compile
(require 'pcase))
Expand Down
37 changes: 17 additions & 20 deletions phpstan.el
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,11 @@

(defcustom phpstan-flycheck-auto-set-executable t
"Set flycheck phpstan-executable automatically."
:type 'boolean
:group 'phpstan)
:type 'boolean)

(defcustom phpstan-enable-on-no-config-file t
"If T, activate config from composer even when `phpstan.neon' is not found."
:type 'boolean
:group 'phpstan)
:type 'boolean)

(defcustom phpstan-memory-limit nil
"Set --memory-limit option."
Expand All @@ -92,7 +90,7 @@
:link '(url-link :tag "PHP Manual"
"https://www.php.net/manual/ini.core.php#ini.memory-limit")
:safe (lambda (v) (or (null v) (stringp v)))
:group 'phpstan)
:local t)

(defcustom phpstan-docker-image "ghcr.io/phpstan/phpstan"
"Docker image URL or Docker Hub image name or NIL."
Expand All @@ -104,39 +102,39 @@
:link '(url-link :tag "GitHub Container Registry"
"https://github.com/orgs/phpstan/packages/container/package/phpstan")
:safe (lambda (v) (or (null v) (stringp v)))
:group 'phpstan)
:local t)

(defcustom phpstan-use-xdebug-option nil
"Set --xdebug option."
:type '(choice (const :tag "Set --xdebug option dynamically" auto)
(const :tag "Add --xdebug option" t)
(const :tag "No --xdebug option" nil))
:safe #'symbolp
:group 'phpstan)
:local t)

(defcustom phpstan-generate-baseline-options '("--generate-baseline" "--allow-empty-baseline")
"Command line options for generating PHPStan baseline."
:type '(repeat string)
:safe #'listp
:group 'phpstan)
:local t)

(defcustom phpstan-baseline-file "phpstan-baseline.neon"
"File name of PHPStan baseline file."
:type 'string
:safe #'stringp
:group 'phpstan)
:local t)

(defcustom phpstan-tip-message-prefix "💡 "
"Prefix of PHPStan tip message."
:type 'string
:safe #'stringp
:group 'phpstan)
:local t)

(defcustom phpstan-identifier-prefix "🪪 "
"Prefix of PHPStan error identifier."
:type 'string
:safe #'stringp
:group 'phpstan)
:local t)

(defcustom phpstan-enable-remote-experimental nil
"Enable PHPStan analysis remotely by TRAMP.
Expand All @@ -146,32 +144,31 @@ This feature is experimental and should be used with caution as it may
have unexpected behaviors or performance implications."
:type 'boolean
:safe #'booleanp
:group 'phpstan)
:local t)

(defconst phpstan-template-dump-type "\\PHPStan\\dumpType();")
(defconst phpstan-template-dump-phpdoc-type "\\PHPStan\\dumpPhpDocType();")

(defcustom phpstan-intert-dump-type-templates (cons phpstan-template-dump-type
phpstan-template-dump-phpdoc-type)
"Default template of PHPStan dumpType insertion."
:type '(cons string string)
:group 'phpstan)
:type '(cons string string))

(defcustom phpstan-disable-buffer-errors nil
"If non-NIL, don't keep errors per buffer to save memory."
:type 'boolean
:group 'phpstan)
:type 'boolean)

(defcustom phpstan-not-ignorable-identifiers '("ignore.parseError")
"Lists identifiers prohibited from being added to @phpstan-ignore tags."
:type '(repeat string))

(defcustom phpstan-activate-editor-mode nil
"Controls how PHPStan's editor mode is activated."
:local t
:type '(choice (const :tag "Automatic (based on version)" nil)
(const :tag "Editor mode will be actively enabled, regardless of the PHPStan version." 'enabled)
(const :tag "Editor mode will be explicitly disabled." 'disabled)))
(const :tag "Editor mode will be actively enabled, regardless of the PHPStan version." enabled)
(const :tag "Editor mode will be explicitly disabled." disabled))
:safe (lambda (v) (memq v '(nil enabled disabled)))
:local t)

(defvar-local phpstan--use-xdebug-option nil)

Expand Down Expand Up @@ -573,7 +570,7 @@ it returns the value of `SOURCE' as it is."

If a cached result for EXECUTABLE exists, it is returned directly.
Otherwise, this function attempts to determine support by retrieving
the PHPStan version using 'phpstan --version' command."
the PHPStan version using `phpstan --version' command."
(pcase phpstan-activate-editor-mode
('enabled t)
('disabled nil)
Expand Down