Skip to content

Comments

Static Analysis with Psalm#105

Merged
greg0ire merged 2 commits intodoctrine:1.3.xfrom
greg0ire:psalm-sa
May 12, 2020
Merged

Static Analysis with Psalm#105
greg0ire merged 2 commits intodoctrine:1.3.xfrom
greg0ire:psalm-sa

Conversation

@greg0ire
Copy link
Member

@greg0ire greg0ire commented May 1, 2020

No description provided.

@greg0ire
Copy link
Member Author

greg0ire commented May 1, 2020

The action will be visible only after this is merged, but you can see how it looks at greg0ire#1

@greg0ire greg0ire changed the title Psalm sa Static Analysis with Psalm May 1, 2020
@greg0ire greg0ire requested review from Ocramius and alcaeus May 2, 2020 10:44
@greg0ire greg0ire force-pushed the psalm-sa branch 2 times, most recently from c122725 to e14f55a Compare May 2, 2020 11:41
@greg0ire
Copy link
Member Author

greg0ire commented May 2, 2020

@localheinz @bendavies please review

@greg0ire
Copy link
Member Author

greg0ire commented May 2, 2020

I force pushed to add cs2pr

@Ocramius
Copy link
Member

Ocramius commented May 2, 2020 via email

run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Psalm"
run: "vendor/bin/psalm --output-format=checkstyle | cs2pr"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psalm has native support, no need for cs2pr
vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="lib/Doctrine/Persistence" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, didn't mean to leave those out

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this will be hard to do until 2.0 and until we use phpunit 8, we should probably leave those out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm giving a try in case that's not that big of an issue.

Copy link
Member Author

@greg0ire greg0ire May 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bendavies I managed to make it work! Locally. And now the build Travis fails because phpunit 8 requires php 7.2. So I'm removing these commits, but they are still on a branch on my machine 🙈
If it were just me, I would drop 7.1, but I think most maintainers are not very keen on that on bugfix branches

name: "Continuous Integration"

on:
pull_request:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no CI runs on branches?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the point of that?

Copy link

@bendavies bendavies May 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you require PRs to be up to date before merging?
if not, then a passing PR could fail on the branch after merging?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't, and I hadn't thought of that possibility. That being said, it will not prevent the PR from being merged.

@greg0ire greg0ire force-pushed the psalm-sa branch 2 times, most recently from 58955a4 to 05eae23 Compare May 2, 2020 21:31
with:
path: "~/.composer/cache"
key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "${{ matrix.php-version }}-composer-locked-"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add php- as discussed?

psalm.xml Outdated
<?xml version="1.0"?>
<psalm
totallyTyped="false"
errorLevel="5"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any more as per other projects?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower is better, and we can have lvl 4 with 0 modifications, so let's do that.

If we added type hints to this project, the SymfonyFileLocator would not
be compatible with the interface. Changing the phpdoc of the interface
is a small enough BC-break that allows us to get back to a valid state.
@greg0ire greg0ire merged commit 16fbd29 into doctrine:1.3.x May 12, 2020
@greg0ire greg0ire self-assigned this May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants