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

Clean up code to follow code standards #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bradp
Copy link
Contributor

@bradp bradp commented Dec 3, 2024

Proposed changes

This adds composer run lint and composer run test to run the code standards against our codebase & fixes up the current code to match it.

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • [-] I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

There is definitely some more work that could be done here, along with some other cleanup and tests, but it's a good start.

@@ -37,6 +37,18 @@
"require-dev": {
"newfold-labs/wp-php-standards": "^1.2.3"
},
"scripts": {
"fix": [
"vendor/bin/phpcbf --standard=phpcs.xml ."
Copy link
Contributor

Choose a reason for hiding this comment

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

Composer scripts don't need vendor/bin, it's naturally in $PATH for Composer.

@@ -37,6 +37,18 @@
"require-dev": {
"newfold-labs/wp-php-standards": "^1.2.3"
},
"scripts": {
"fix": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider calling it cs-fix, per php-pds/composer-script-names, similarly below.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't feel very strongly on this. I like the idea of conventions but I don't particularly like the name.

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.

2 participants