From 9069f57a5075101372f7816add59e3e2ce9092a7 Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Wed, 22 Apr 2020 14:10:52 +0200 Subject: [PATCH 1/3] drop hide autoload errors --- .github/workflows/standalone_run.yaml | 4 ++-- src/Application/RectorApplication.php | 4 ---- src/Configuration/Configuration.php | 11 ----------- src/Configuration/Option.php | 5 ----- src/Console/Command/ProcessCommand.php | 7 ------- 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/.github/workflows/standalone_run.yaml b/.github/workflows/standalone_run.yaml index a6f14062fa09..a866c2a32f8c 100644 --- a/.github/workflows/standalone_run.yaml +++ b/.github/workflows/standalone_run.yaml @@ -39,5 +39,5 @@ jobs: cd symfony-demo-dir ../rector-dir/vendor/bin/rector - # --hide-autoload-errors due to skipped dev deps and mixes tests in /src - ../rector-dir/vendor/bin/rector process src --set code-quality --hide-autoload-errors + # autoload errors due to remove --dev and mixed dependencies in /src and /tests + ../rector-dir/vendor/bin/rector process src --set code-quality diff --git a/src/Application/RectorApplication.php b/src/Application/RectorApplication.php index 5c086e4f4258..8046bd732e00 100644 --- a/src/Application/RectorApplication.php +++ b/src/Application/RectorApplication.php @@ -209,10 +209,6 @@ private function tryCatchWrapper(SmartFileInfo $smartFileInfo, callable $callbac $callback($smartFileInfo); } catch (AnalysedCodeException $analysedCodeException) { - if ($this->configuration->shouldHideAutoloadErrors()) { - return; - } - $this->notParsedFiles[] = $smartFileInfo; $this->errorAndDiffCollector->addAutoloadError($analysedCodeException, $smartFileInfo); diff --git a/src/Configuration/Configuration.php b/src/Configuration/Configuration.php index fb334582a07a..76b390ce6d70 100644 --- a/src/Configuration/Configuration.php +++ b/src/Configuration/Configuration.php @@ -22,11 +22,6 @@ final class Configuration */ private $isDryRun = false; - /** - * @var bool - */ - private $hideAutoloadErrors = false; - /** * @var string|null */ @@ -104,7 +99,6 @@ public function resolveFromInput(InputInterface $input): void { $this->isDryRun = (bool) $input->getOption(Option::OPTION_DRY_RUN); $this->shouldClearCache = (bool) $input->getOption(Option::OPTION_CLEAR_CACHE); - $this->hideAutoloadErrors = (bool) $input->getOption(Option::HIDE_AUTOLOAD_ERRORS); $this->mustMatchGitDiff = (bool) $input->getOption(Option::MATCH_GIT_DIFF); $this->showProgressBar = $this->canShowProgressBar($input); $this->isCacheDebug = (bool) $input->getOption(Option::CACHE_DEBUG); @@ -151,11 +145,6 @@ public function isDryRun(): bool return $this->isDryRun; } - public function shouldHideAutoloadErrors(): bool - { - return $this->hideAutoloadErrors; - } - public function showProgressBar(): bool { if ($this->ciDetector->isCiDetected()) { diff --git a/src/Configuration/Option.php b/src/Configuration/Option.php index 62ba02ee0618..890c07e1a586 100644 --- a/src/Configuration/Option.php +++ b/src/Configuration/Option.php @@ -36,11 +36,6 @@ final class Option */ public const PHP_VERSION_FEATURES = 'php_version_features'; - /** - * @var string - */ - public const HIDE_AUTOLOAD_ERRORS = 'hide-autoload-errors'; - /** * @var string */ diff --git a/src/Console/Command/ProcessCommand.php b/src/Console/Command/ProcessCommand.php index d916505cd0b7..7cd7a7e08392 100644 --- a/src/Console/Command/ProcessCommand.php +++ b/src/Console/Command/ProcessCommand.php @@ -169,13 +169,6 @@ protected function configure(): void 'File with extra autoload' ); - $this->addOption( - Option::HIDE_AUTOLOAD_ERRORS, - 'e', - InputOption::VALUE_NONE, - 'Hide autoload errors for the moment.' - ); - $this->addOption( Option::MATCH_GIT_DIFF, null, From 4f16277b57d183bc019ee0872548b9206f477765 Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Wed, 22 Apr 2020 14:20:10 +0200 Subject: [PATCH 2/3] CI: drop testing drupal, external responsibility --- .github/workflows/drupal_rector_examples.yml | 44 -------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/drupal_rector_examples.yml diff --git a/.github/workflows/drupal_rector_examples.yml b/.github/workflows/drupal_rector_examples.yml deleted file mode 100644 index cb1e5338bfdc..000000000000 --- a/.github/workflows/drupal_rector_examples.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: drupal_rector_examples - -on: - pull_request: null - push: - branches: - - master - -jobs: - drupal_rector_examples: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: shivammathur/setup-php@v2 - with: - php-version: 7.3 - coverage: none # disable xdebug, pcov - extensions: "intl" - - # Run standalone install in non-root package, ref https://github.com/rectorphp/rector/issues/732 - - run: | - # Download the latest Drupal core project and all its dependencies - composer create-project drupal/recommended-project drupal --dev --no-progress - - - run: | - # Install drupal-rector - cd drupal - composer require palantirnet/drupal-rector --no-progress - - - run: | - # Prepare rector config files with Drupal specific settings - cd drupal - cp vendor/palantirnet/drupal-rector/rector.yml . - - - run: | - # Prepare rector_examples folder in the drupal modules directory - cd drupal - mkdir -p web/modules/custom - cp -r vendor/palantirnet/drupal-rector/rector_examples web/modules/custom/. - - - run: | - # Run Rector - cd drupal - vendor/bin/rector process web/modules/custom/rector_examples --debug From faa5d2f1b4bac86dc8276dd91c4e5fc2d0429198 Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Wed, 22 Apr 2020 14:21:58 +0200 Subject: [PATCH 3/3] spaces --- .github/workflows/validate_fixtures.yaml | 3 ++- .github/workflows/validate_sets.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_fixtures.yaml b/.github/workflows/validate_fixtures.yaml index 40768d4984ff..db9bf8c2f4ad 100644 --- a/.github/workflows/validate_fixtures.yaml +++ b/.github/workflows/validate_fixtures.yaml @@ -14,6 +14,7 @@ jobs: - uses: shivammathur/setup-php@v1 with: php-version: 7.4 - coverage: none # disable xdebug, pcov + coverage: none + - run: composer install --no-progress - run: bin/rector validate-fixtures --ansi diff --git a/.github/workflows/validate_sets.yaml b/.github/workflows/validate_sets.yaml index 9d1e87c5edcc..efb75ed97039 100644 --- a/.github/workflows/validate_sets.yaml +++ b/.github/workflows/validate_sets.yaml @@ -14,6 +14,7 @@ jobs: - uses: shivammathur/setup-php@v1 with: php-version: 7.4 - coverage: none # disable xdebug, pcov + coverage: none + - run: composer install --no-progress - run: bin/rector validate-sets --ansi