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

Rector 0.10 #134

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
17b36a4
composer: update rector to 0.8
TomasVotruba Sep 12, 2020
9732bf1
switch configs from YML to PHP
TomasVotruba Sep 12, 2020
e1e09b0
drop duplicated info in editorconfig
TomasVotruba Sep 12, 2020
b6ad9c8
Add phpstan and rector dev trunk
mglaman Mar 24, 2021
4964e07
Merge branch 'rector-08' into rector-0.10
mglaman Mar 24, 2021
c043b05
Add back EntityDeleteMultipleRector
mglaman Mar 24, 2021
e02f8cc
Update rule definitions for Rector 0.10
mglaman Mar 24, 2021
541584c
Fix remaining usages of Option::EXCLUDE_PATHS
mglaman Mar 24, 2021
f29c567
PHPStan workflow to catch unused calls.
mglaman Mar 24, 2021
669038d
Add PHPUnit and initial test
mglaman Mar 28, 2021
7c81ed4
Update local packages flow
mglaman Mar 28, 2021
ece4915
Handle ~/drupal in specific workflow
mglaman Mar 28, 2021
d763416
Normalize GitHub flows
mglaman Mar 28, 2021
f72dfaa
Add PHPUnit flow, move deprecation-index tests to PHPUnit
mglaman Mar 29, 2021
dcb66ff
Move away from Behat and to specific commands
mglaman Mar 29, 2021
41e9587
Must add php suffix
mglaman Mar 29, 2021
6a58e12
Run with debug, remove duplicated core discovery
mglaman Mar 29, 2021
c1d9e48
Add missing 8.4 deprecation Rector rules config
mglaman Apr 7, 2021
4f4c56a
Ensure we load the PHPUnit bootstrap for test class autoloading
mglaman Apr 7, 2021
0eb9c38
Update the integration test
mglaman Apr 7, 2021
bfacd7d
Expect dry-run exit code 1
mglaman Apr 7, 2021
3bea584
Remove phpunit bootstrap
mglaman Apr 7, 2021
1d08f2b
Update examples_updated for db_*
mglaman Apr 7, 2021
02c49a5
Fix comments: parentNode is now just parent
mglaman Apr 8, 2021
9df523a
nextNode is just next
mglaman Apr 9, 2021
f03df1b
Fix remaining diff errors
mglaman Apr 9, 2021
ee7c775
rector/rector:0.10.4 stopped returning applied rectors
mglaman Apr 9, 2021
71b077f
Use constants for accessing attribute values
mglaman Apr 15, 2021
bd16f1a
Remove include of "core/tests/bootstrap.php"
mglaman Apr 15, 2021
abd687d
0.10.6 restores ability to check file_diffs for applied rules
mglaman Apr 15, 2021
87ac7f2
Update remaining `yml` documentation
mglaman Apr 15, 2021
31e1c1c
Initial work to fix test traits autoloading
mglaman Apr 15, 2021
5146376
Make PHPUnit autoloading bootstrap file generic for all config
mglaman Apr 15, 2021
b20270b
Use webflo/drupal-finder
mglaman Apr 15, 2021
d33c4b0
Ensure test/fixtures directory
mglaman Apr 15, 2021
7d31554
Update phpstan.neon to remove old config files
mglaman Apr 15, 2021
4f498c8
Fix notice on assert for a prefixed class
mglaman Apr 16, 2021
8de2317
Run a test against webform for catching output errors
mglaman Apr 16, 2021
d66bdc7
Dynamic PhpunitVersionDependentTestCompatibilityTrait version aliasing
mglaman Apr 16, 2021
619f96a
Do not error with Webform if it fails
mglaman Apr 16, 2021
ad43a86
Run on different PHPUnit versions, fix hardcoded trait namespace
mglaman Apr 16, 2021
6590232
Refactor Gitflow Actions.
damontgomery Apr 26, 2021
a1aa889
Removed Behat automated tests.
damontgomery Apr 26, 2021
376c576
Include Symfony YAML since it's required for the PhpUnit tests.
damontgomery Apr 26, 2021
95eff0c
Recursive copy for functional test.
damontgomery Apr 26, 2021
1d9dfe2
Document running PHPUnit
mglaman Apr 28, 2021
e821abd
Add documentation about PHP version
mglaman Apr 28, 2021
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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ insert_final_newline = true

[composer.{json,lock}]
indent_size = 4

[*.neon]
indent_size = 4
indent_style = tab
55 changes: 55 additions & 0 deletions .github/workflows/canary__webform_module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: canary__webform_module
# There are some non-related errors. So this run acts as a canary
# that we manually review to shake loose errors.

# This test will run on every pull request, and on every commit on any branch
on: [push, pull_request]

jobs:
run_rector_on_webform:
name: Check webform module as a canary
# START: SHARED SETUP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
# Uncomment to enable SSH access to Github Actions - https://github.com/marketplace/actions/debugging-with-tmate#getting-started
# - name: Debugging with tmate
# uses: mxschmitt/action-tmate@v2
# END: SHARED SETUP
# START: SHARED DRUPAL INSTALL SETUP
- name: Setup Drupal
run: |
COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:~8 ~/drupal --no-interaction
cd ~/drupal
composer config minimum-stability dev
composer config prefer-stable true
composer config preferred-install dist
composer config repositories.drupal composer https://packages.drupal.org/8
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:~8 --with-all-dependencies
# We add a local repository `repositories.0` which takes precendence over the packagist repository that is automatically added.
- name: Install Drupal Rector
run: |
cd ~/drupal
composer config repositories.drupal-rector "{\"type\": \"path\", \"url\": \"$GITHUB_WORKSPACE\", \"options\": {\"symlink\": false}}"
composer require palantirnet/drupal-rector:@dev --no-progress
- name: Install Drupal Rector Config
run: |
cd ~/drupal
cp vendor/palantirnet/drupal-rector/rector.php .
# END: SHARED DRUPAL INSTALL SETUP
- name: Include webform and its conditionally supported dependencies
run: |
cd ~/drupal
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/bootstrap drupal/webform
- run: |
# Run Rector
cd ~/drupal
vendor/bin/rector process web/modules/contrib/webform --debug
# @todo: remove when PHPStan doesn't choke on WebformLikert doc block
continue-on-error: true
65 changes: 65 additions & 0 deletions .github/workflows/functional_test__rector_examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: functional_test__rector_examples

# This test will run on every pull request, and on every commit on any branch
on: [push, pull_request]

jobs:
run_functional_test:
name: Run functional test
# START: SHARED SETUP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
# Uncomment to enable SSH access to Github Actions - https://github.com/marketplace/actions/debugging-with-tmate#getting-started
# - name: Debugging with tmate
# uses: mxschmitt/action-tmate@v2
# END: SHARED SETUP
# START: SHARED DRUPAL INSTALL SETUP
- name: Setup Drupal
run: |
COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:~8 ~/drupal --no-interaction
cd ~/drupal
composer config minimum-stability dev
composer config prefer-stable true
composer config preferred-install dist
composer config repositories.drupal composer https://packages.drupal.org/8
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:~8 --with-all-dependencies
# We add a local repository `repositories.0` which takes precendence over the packagist repository that is automatically added.
- name: Install Drupal Rector
run: |
cd ~/drupal
composer config repositories.drupal-rector "{\"type\": \"path\", \"url\": \"$GITHUB_WORKSPACE\", \"options\": {\"symlink\": false}}"
composer require palantirnet/drupal-rector:@dev --no-progress
- name: Install Drupal Rector Config
run: |
cd ~/drupal
cp vendor/palantirnet/drupal-rector/rector.php .
# END: SHARED DRUPAL INSTALL SETUP
- name: Prepare rector_examples folder in the drupal modules directory
run: |
cd ~/drupal
mkdir -p web/modules/custom
cp -R vendor/palantirnet/drupal-rector/rector_examples web/modules/custom
# dry-run is expected to return exit code 1 if there are changes, which we are expecting to happen, here.
- name: Run rector against Drupal (dry-run)
run: |
cd ~/drupal
vendor/bin/rector process web/modules/custom/rector_examples --dry-run --debug || if (($? == 1)); then true; else false; fi
- name: Run rector against Drupal
run: |
cd ~/drupal
vendor/bin/rector process web/modules/custom/rector_examples --debug
# diff options:
# -r: recursive
# -u: show the joined context, like git diff
# -b: ignore whitespace
# -B: ignore lines that are only whitespace
- name: Check that the updated examples match expectations
run: |
diff -rubB rector_examples_updated ~/drupal/web/modules/custom/rector_examples
59 changes: 0 additions & 59 deletions .github/workflows/local_package_functional_tests.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/local_package_run_rector.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .github/workflows/packagist_package_run_rector.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/static_analysis__phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: static_analysis__phpstan

# This test will run on every pull request, and on every commit on any branch
on: [push, pull_request]

jobs:
run_static_analysis_phpstan_analyze:
name: Static analysis with PHPStan
# START: SHARED SETUP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
# Uncomment to enable SSH access to Github Actions - https://github.com/marketplace/actions/debugging-with-tmate#getting-started
# - name: Debugging with tmate
# uses: mxschmitt/action-tmate@v2
# END: SHARED SETUP
- run: composer install
- run: vendor/bin/phpstan
25 changes: 25 additions & 0 deletions .github/workflows/unit_tests__phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: unit_tests__phpunit

# This test will run on every pull request, and on every commit on any branch
on: [push, pull_request]

jobs:
run_unit_tests_with_phpunit:
name: Run unit tests with PHPUnit
# START: SHARED SETUP
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: 7.3
coverage: none # disable xdebug, pcov
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
# Uncomment to enable SSH access to Github Actions - https://github.com/marketplace/actions/debugging-with-tmate#getting-started
# - name: Debugging with tmate
# uses: mxschmitt/action-tmate@v2
# END: SHARED SETUP
- run: composer install
- run: composer create-project drupal/recommended-project:^8.9 tests/fixtures/drupal
- run: vendor/bin/phpunit
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
/vendor
/composer.lock

/features/tmp/*
!/features/tmp/.placeholder
/.phpunit.cache
/tests/fixtures/drupal
Loading