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

Replace PHPStan with drupal-check for deprecation testing #117

Merged
merged 1 commit into from
Nov 18, 2020

Conversation

TravisCarden
Copy link
Contributor

This replaces PHPStan installed directly in the fixture with drupal-check installed in ORCA itself, for two benefits: 1) it improves the resiliency of deprecation testing, making it less susceptible to total failure from errors in tested code, and 2) it improves the production-likeness of the fixture by removing packages that aren't strictly necessary and can't be assumed to be present in a customer build.

If you were depending on PHPStan being in the fixture, you can add it back yourself in a custom script:

#!/usr/bin/env bash

# Set the current working directory to that of the script so relative paths
# are resolved predictably.
cd "$(dirname "$0")" || exit 1

# Reuse ORCA's own includes for its $PATH additions and environment variables.
# This example assumes that your script is at a directory depth of two (2), e.g.,
# my_module/bin/travis/before_script.sh
source ../../../orca/bin/travis/_includes.sh

# Move to the fixture directory if present or exit early if not, as in the case
# of the static analysis job, for example, which creates no fixture.
cd "$ORCA_FIXTURE_DIR" | exit

composer require mglaman/phpstan-drupal-deprecations nette/di:^3.0

@TravisCarden TravisCarden added enhancement New feature or request breaking Backwards-incompatible labels Nov 18, 2020
@TravisCarden TravisCarden merged commit 1b34824 into acquia:develop Nov 18, 2020
@TravisCarden TravisCarden deleted the feature/drupal-check branch November 18, 2020 19:03
@TravisCarden TravisCarden removed the breaking Backwards-incompatible label Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant