Skip to content
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

Adds psalm and fixes first few findings #151

Merged
merged 3 commits into from
Aug 5, 2019
Merged

Conversation

NielsdeBlaauw
Copy link
Member

No description provided.

@menno-ll
Copy link
Member

menno-ll commented Jun 11, 2019

psalm requires php 7.1 >=
We currently only define php 7.0 >=, so there is a change of errors occuring

see https://github.com/vimeo/psalm/blob/master/docs/running_psalm/installation.md

@menno-ll
Copy link
Member

menno-ll commented Jun 11, 2019

In the composer test script, testing with psalm takes a long time. We can make it faster for example if we only check changed files. maybe we should consider that. See command options with /vendor/bin/psalm --help or https://github.com/vimeo/psalm/blob/master/docs/running_psalm/command_line_usage.md

Command outputs:

➜  Clarkson-Core git:(feature/psalm) vendor/bin/psalm --threads=8 --diff --diff-methods --show-info=false
Scanning files...
Analyzing files...

------------------------------
No errors found!
------------------------------

Checks took **7.10** seconds and used 313.776MB of memory
No files analyzed
➜  Clarkson-Core git:(feature/psalm) vendor/bin/psalm --show-info=false                                  
Scanning files...
Analyzing files...

------------------------------
No errors found!
------------------------------

Checks took **13.76** seconds and used 361.078MB of memory
Psalm was able to infer types for 85.2657% of the codebase
➜  Clarkson-Core git:(feature/psalm) 

@menno-ll
Copy link
Member

We can consider automatic fixing just like phpcbf that they have built in.

see https://github.com/vimeo/psalm/blob/master/docs/manipulating_code/fixing.md

@NielsdeBlaauw
Copy link
Member Author

psalm requires php 7.1 >=
We currently only define php 7.0 >=, so there is a change of errors occuring

see https://github.com/vimeo/psalm/blob/master/docs/running_psalm/installation.md

Versie van psalm die we hier gebruiken v3.2.12. Die zou nog wel compatible moeten zijn met 7.0, maar gezien de wijzigingen met de #152 kunnen we van 7.1 uitgaan.

@NielsdeBlaauw
Copy link
Member Author

We can consider automatic fixing just like phpcbf that they have built in.

Risky for now. Let's make a ticket and explore this later.

@NielsdeBlaauw NielsdeBlaauw merged commit 1c036ee into master Aug 5, 2019
@NielsdeBlaauw NielsdeBlaauw deleted the feature/psalm branch August 5, 2019 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants