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

WP Plugin - Rector - automatic and manual fixes #695

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
14acdad
Start tracking the composer lock file to make sure we are installing …
claytoncollie Jan 29, 2024
825dc52
Update the 10up phpcs package to 3.0.0 and add some extra commands
claytoncollie Jan 29, 2024
48a93f6
Adjust phpcs config to scan files properly
claytoncollie Jan 29, 2024
4ae5d43
Automatic linting with phpcbf
claytoncollie Jan 29, 2024
10a669a
Remove exception from phpcs config
claytoncollie Jan 29, 2024
f468cd8
Rename parameter array to be rules
claytoncollie Jan 29, 2024
7fa403a
Use wp _safe_redirect instead of wp_redirect
claytoncollie Jan 29, 2024
11a4c2e
Ignore last parameter is not being used
claytoncollie Jan 29, 2024
75ef028
remove unused parameter
claytoncollie Jan 29, 2024
ea3aa5b
Ignore tax query being slow
claytoncollie Jan 29, 2024
6955004
Ignore nonce verification warning
claytoncollie Jan 29, 2024
93495f5
Use strict comparison for in array
claytoncollie Jan 29, 2024
ed82abf
Use wp _safe_redirect instead of wp_redirect
claytoncollie Jan 29, 2024
aee5aa9
Translate string and escape output
claytoncollie Jan 29, 2024
378ab91
Remove unused parameter and docblock
claytoncollie Jan 29, 2024
fe5cb6b
Remove unused parameter and docblock
claytoncollie Jan 29, 2024
5842bb1
Remove unused parameter and docblock
claytoncollie Jan 29, 2024
5ada585
Change the admin notice to break item down into smaller pieces
claytoncollie Jan 29, 2024
1f8a7ab
change parameter to not be a reserved keyword
claytoncollie Jan 29, 2024
e4bf192
Require Rector. Provide config. Add action to enforce standard.
claytoncollie Feb 15, 2024
34c6284
Fix constant reference in config
claytoncollie Feb 15, 2024
faf1d18
FOrce short array syntax
claytoncollie Feb 15, 2024
43aa5a2
Enforce Rector coding standards. Add parameter and return type hintin…
claytoncollie Feb 15, 2024
f155711
Ignore certain files and enforce short array syntax
claytoncollie Feb 15, 2024
92ab1b9
Enforce short array syntax
claytoncollie Feb 15, 2024
2843df0
Merge feature/wp-plugin-short-array-syntax into feature/wp-rector
claytoncollie Feb 15, 2024
228dbb1
Merge branch 'develop' into feature/wp-rector
nicholasio Feb 29, 2024
f24d8c9
fix: fixing phpcs and rector
nicholasio Feb 29, 2024
77c8e60
fix: do not mess with php-jwt
nicholasio Feb 29, 2024
9aa10df
Merge develop into feature/wp-rector
claytoncollie Apr 3, 2024
39e73fd
Linting
claytoncollie Apr 3, 2024
44904d6
Merge develop into feature/wp-rector
claytoncollie Apr 3, 2024
a78b08b
REturn types
claytoncollie Apr 3, 2024
b6653c3
Preview Test
claytoncollie Apr 3, 2024
1e2e1e1
Merge branch 'develop' into feature/wp-rector
nicholasio May 8, 2024
634824b
fix: tests
nicholasio May 8, 2024
da086af
chore: changeset
nicholasio May 8, 2024
0b5fa9e
fix: making rector happy
nicholasio May 8, 2024
cfc32bd
chore: make phpcs happy
nicholasio May 8, 2024
0d7a66d
fix: restore deleted code
nicholasio May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lucky-gorillas-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/headstartwp": minor
---

Rector refactoring
19 changes: 19 additions & 0 deletions .github/workflows/rector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Rector check

on: pull_request

jobs:
rector:
name: rector
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: composer install
run: cd ./wp/headless-wp && composer install --ignore-platform-reqs
- name: Enforce PHP standards with Rector
run: cd ./wp/headless-wp && composer run rector
3 changes: 3 additions & 0 deletions wp/headless-wp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"php-stubs/wordpress-stubs": "^6.1",
"php-stubs/wordpress-tests-stubs": "^6.1",
"wordpress/wordpress-develop": "dev-trunk",
"rector/rector": "^1.0",
"yoast/wordpress-seo": "^22.1"
},
"autoload": {
Expand All @@ -51,6 +52,8 @@
"scripts": {
"lint": "./vendor/bin/phpcs --standard=phpcs.xml",
"lint-fix": "./vendor/bin/phpcbf --standard=phpcs.xml",
"rector": "./vendor/bin/rector --dry-run",
"rector-fix": "./vendor/bin/rector",
"post-install-cmd": [
"php -r \"copy('vendor/wordpress/wordpress-develop/wp-tests-config-sample.php', 'vendor/wordpress/wordpress-develop/wp-tests-config.php');\""
],
Expand Down
Loading
Loading