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: lint and remove useless variables [phpcs] #2975

Merged

Conversation

justlevine
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This PR adds the (auto-fixable) SlevomatCodingStandard.Variables.UselessVariable sniff to our PHPCS ruleset, and remediates the handful of smells in our codebase.

While useless variables aren't inherently a bad thing, the standardization will make code refractoring easier (since it'l be easier to spot duplicate code), and the fact that its auto-fixable means that there's no additional load for project maintainers.

Does this close any currently open issues?

Any relevant logs, error output, GraphiQL screenshots, etc?

Any other comments?

Where has this been tested?

Operating System: Ubuntu 20.04 (wsl2 + devilbox + php 8.1.15)

WordPress Version: 6.3.2

@justlevine justlevine added Status: In Review Needs to be reviewed by a project maintainer before merge Type: Chore (updating CI tasks etc; no production code change) scope: code quality Affects codebase complexity and maintainability labels Nov 1, 2023
Copy link

codeclimate bot commented Nov 1, 2023

Code Climate has analyzed commit 500825d and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Coverage Status

coverage: 84.751% (-0.005%) from 84.756% when pulling 500825d on justlevine:chore/remove-useless-variables into ef67e99 on wp-graphql:develop.

@justlevine
Copy link
Collaborator Author

Those missing coverage lines weren't changed in this PR and dont currently appear in develop. Not sure what codeclimate is comparing against, but it can be ignored

@justlevine justlevine added the Needs: Reviewer Response This needs the attention of a codeowner or maintainer. label Nov 1, 2023
@jasonbahl jasonbahl merged commit e11e948 into wp-graphql:develop Nov 1, 2023
26 of 27 checks passed
@justlevine justlevine deleted the chore/remove-useless-variables branch November 1, 2023 21:24
@jasonbahl jasonbahl mentioned this pull request Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Reviewer Response This needs the attention of a codeowner or maintainer. scope: code quality Affects codebase complexity and maintainability Status: In Review Needs to be reviewed by a project maintainer before merge Type: Chore (updating CI tasks etc; no production code change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants