Skip to content

Commit

Permalink
Fix build and deprecated usages of excludes_analyse (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
mglaman authored Jul 20, 2021
1 parent 35cbe19 commit 7b6c618
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 51 deletions.
19 changes: 0 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,6 @@ jobs:
command: |
cd /tmp/drupal
./vendor/bin/drupal-check -vvv web/core/modules/dynamic_page_cache
test_lightning:
<<: *defaults
steps:
- setup-job
# acquia/lightning-project does not require-dev Drupal's require-dev.
# see PR https://github.com/acquia/lightning-project/pull/101
- create-drupal-project:
project: 'acquia/lightning-project'
require_dev: false
- global-require
- run:
name: Global - Run against a file
command: |
drupal-check /tmp/drupal/docroot/core/install.php
# - run:
# name: Global - Run against a module
# command: |
# drupal-check /tmp/drupal/docroot/core/modules/dynamic_page_cache
test_contrib:
<<: *defaults
steps:
Expand Down Expand Up @@ -222,7 +204,6 @@ workflows:
- lint
- test_drupal
- test_drupal_project
- test_lightning
- test_global_require_with_drush
- test_symfony_console_conflict
- test_contrib
Expand Down
36 changes: 8 additions & 28 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,10 @@ jobs:
- name: Remove vendor directory for integration testing
run: rm -rf vendor
- name: Setup Drupal
run: |
COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }} ~/drupal --no-interaction
cd ~/drupal
composer config minimum-stability dev
composer config prefer-stable true
composer config preferred-install dist
composer config repositories.0 "{\"type\": \"path\", \"url\": \"$GITHUB_WORKSPACE\", \"options\": {\"symlink\": false}}"
composer config repositories.1 composer https://packages.drupal.org/8
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:${{ matrix.drupal }} --with-all-dependencies
- name: "Add phpspec/prophecy-phpunit"
run: |
cd ~/drupal
COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpspec/prophecy-phpunit:^2
if: ${{ matrix.drupal == '^9.0' }}
uses: bluehorndigital/[email protected]
with:
version: ${{ matrix.drupal }}
path: ~/drupal
- name: "require drupal-check"
run: |
cd ~/drupal
Expand Down Expand Up @@ -102,20 +92,10 @@ jobs:
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
- name: Setup Drupal
run: |
COMPOSER_MEMORY_LIMIT=-1 composer create-project drupal/recommended-project:${{ matrix.drupal }} ~/drupal --no-interaction
cd ~/drupal
composer config minimum-stability dev
composer config prefer-stable true
composer config preferred-install dist
composer config repositories.0 "{\"type\": \"path\", \"url\": \"$GITHUB_WORKSPACE\", \"options\": {\"symlink\": false}}"
composer config repositories.1 composer https://packages.drupal.org/8
COMPOSER_MEMORY_LIMIT=-1 composer require drupal/core-dev:${{ matrix.drupal }} --with-all-dependencies
- name: "Add phpspec/prophecy-phpunit"
run: |
cd ~/drupal
COMPOSER_MEMORY_LIMIT=-1 composer require --dev phpspec/prophecy-phpunit:^2
if: ${{ matrix.drupal == '^9.0' }}
uses: bluehorndigital/[email protected]
with:
version: ${{ matrix.drupal }}
path: ~/drupal
- name: "require drupal-check"
run: |
cd ~/drupal
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"require": {
"php": "^7.2.5|^8.0",
"composer/xdebug-handler": "^2.0.1",
"composer/xdebug-handler": "^1.1 | ^2.0.1",
"jean85/pretty-package-versions": "^1.5.0 || ^2.0.1",
"mglaman/phpstan-drupal": "^0.12.8",
"nette/neon": "^3.1",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Command/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'parameters' => [
'tipsOfTheDay' => false,
'reportUnmatchedIgnoredErrors' => false,
'excludes_analyse' => [
'excludePaths' => [
'*/tests/Drupal/Tests/Listeners/Legacy/*',
'*/tests/fixtures/*.php',
'*/settings*.php',
Expand All @@ -145,7 +145,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (!empty($this->excludeDirectory)) {
// There may be more than one path passed in, comma separated.
$excluded_directories = explode(',', $this->excludeDirectory);
$configuration_data['parameters']['excludes_analyse'] = array_merge($excluded_directories, $configuration_data['parameters']['excludes_analyse']);
$configuration_data['parameters']['excludePaths'] = array_merge($excluded_directories, $configuration_data['parameters']['excludePaths']);
}

if ($this->isAnalysisCheck) {
Expand Down

0 comments on commit 7b6c618

Please sign in to comment.