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

chore: configure PHPStan static analysis #87

Merged
merged 3 commits into from
May 23, 2023

Conversation

justlevine
Copy link
Contributor

@justlevine justlevine commented May 19, 2023

This PR sets up PHPStan linting for the project.

No CI is currently included, since the plugin fails even scanning at Level 0, but in light of the results of the phpcs audit, I think it makes sense to already include it since you gotta start somewhere.

Follow-up PRs will address actual code issues unearthed by these lints.

image

To test,

  1. run composer install
  2. run composer phpstan.
  3. copy phpstan.neon.dist to phpstan.neon, and change the parameters.level to 8.
  4. rerun composer phpstan

Additional notes

Once you're ready to add a .distignore file or a composer archive property to this project, the phpstan.neon.dist file and /phpstan directory should be excluded.

@justlevine justlevine requested a review from a team as a code owner May 19, 2023 01:41
@changeset-bot
Copy link

changeset-bot bot commented May 19, 2023

⚠️ No Changeset found

Latest commit: 974bc5f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@justlevine
Copy link
Contributor Author

justlevine commented May 19, 2023

Until this is merged/rejected, Ill be tracking error level => fixes in this comment

(Level 9 addresses the use of mixed, and doesn't really add value when working in WordPress.)

@justlevine
Copy link
Contributor Author

I've completed my audit: There are 9 remaining issues once the above PRs are merged.

image

@mindctrl mindctrl merged commit 91a0b48 into wpengine:main May 23, 2023
@justlevine justlevine deleted the chore/phpstan branch May 23, 2023 13:17
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.

3 participants