-
Notifications
You must be signed in to change notification settings - Fork 148
Psalm support #277
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
Psalm support #277
Conversation
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Line exceeds 120 characters; contains 160 characters
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Line exceeds 120 characters; contains 155 characters
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Line exceeds 120 characters; contains 142 characters
does not have any issues, instead of an empty json, it returns nothing, making previous code fail even if the project had no issues.
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Line exceeds 120 characters; contains 156 characters
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Only one argument is allowed per line in a multi-line function call
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Line exceeds 120 characters; contains 151 characters
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS: Line exceeds 120 characters; contains 146 characters
The only issue with that is that you have to run composer global require vimeo/psalm
on your worker manually because of incompatibility issues: #276 (comment)
I haven't yet placed that warning to the docks; I hope you will be able to support me ton fixing the composer.json
file to support vimeo/psalm
.
I'm gonna fix those code styling issues tomorrow...
Thanks!
@panosru Awesome work! Thank you. I can review PR by the end of the week when I have more free time.
- Removed metadata storage
.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Directory .idea
should be in your homedir .gitignore
config (for all your projects).
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't use ZeroConfigPluginInterface
and zero_config
option for this plugin. It will break builds without configuration on PHP5.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corpsee Can you please explain a bit more why will break configuration for PHP 5.6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
canExecuteOnStage
could always return false
if PHP < 7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@garas & @corpsee tbh, I did not read the code of PHP Censor, I just focused on the plugin and just took a few things from other plugins as a reference. I can't yet understand the role of ZeroConfigPluginInterface
and the canExecuteOnStage
and why it will return false
and why that will break compatibility, but since you both say so, then what I should use instead of ZeroConfigPluginInterface
or what should I do to maintain the compatibility for PHP 5.6 and keep ZeroConfigPluginInterface
if that is necessary?
src/Plugin/Psalm.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess It should be:
$this->allowedWarnings = -1; $this->allowedErrors = -1;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I intentionally placed zero instead of minus one. Minus one will ignore any errors and warnings while 0 will not.
@panosru I created branch psalm-dep
with installed vimeo/psalm
(v1.1.9
) package for PHP5.6+. If someone wants to use newest version he should install psalm
by himself.
With this changes you may keep ZeroConfigPluginInterface
for the plugin.
@corpsee from your explanation and the comment on the code I believe that I do not fully understand the role of ZeroConfigPluginInterface
. while the name itself is self-explanatory, my question is, why it will break compatibility with PHP 5.6 and what is the difference when using ZeroConfigPluginInterface
.
If I should not use ZeroConfigPluginInterface
do you recommend me to use another interface instead?
Thanks!
-
ZeroConfigPluginInterface
assume that PHP Censor have in dependencies list the plugin's binary because it is case for project without any config file (User don't say path for binary clearly). -
When you manually add
psalm
to.php-censor.yml
config you know what you are doing. And if Psalm broke the build on PHP5.6 it is your fault. But if you don't have any.php-censor.yml
config then default plugins should work fine for all PHP versions.
P.S.: You have 2 variants. You may make plugin non-zero-configurated or you may add psalm
package to PHP Censor installation.
@corpsee Thank you for the explanation! Now I got it! ;)
@panosru Thanks! 👍
The PR merged to master
branch and will be released with next minor version 1.1.0
.
Ref issue #276