Skip to content

Added PHPStan#103

Open
james-hill-matomo wants to merge 1 commit into5.x-devfrom
add-phpstan
Open

Added PHPStan#103
james-hill-matomo wants to merge 1 commit into5.x-devfrom
add-phpstan

Conversation

@james-hill-matomo
Copy link
Copy Markdown

Description

Simplified the setup, refactored pre-push.

  • [NA] I have understood, reviewed, and tested all AI outputs before use
  • [NA] All AI instructions respect security, IP, and privacy rules

Copy link
Copy Markdown
Contributor

@lachiebol lachiebol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question around modified/created and one error

PHPSTAN_BASE_CONFIG=phpstan.neon
if [[ -f "$PHPSTAN_BASE_CONFIG" ]]; then
echo "Running PHPstan at a base level on all plugin files"
$COMMAND analyse -c ${PLUGIN_PATH}/${PHPSTAN_BASE_CONFIG} || STATUS=1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other plugins only ran the pre-push on modified/created, should we also do that one like this?

https://github.com/innocraft/plugin-Cohorts/blob/5.x-dev/.git-hooks-matomo/phpstan-pre-push.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also got this error

Running pre-commit hook in repo: /home/lachlan/matomo-code/matomo_5x-dev/plugins/AnonymousPiwikUsageMeasurement
Running PHPstan at a base level on all plugin files
Project config file at path /phpstan.neon does not exist.
error: failed to push some refs to 'https://github.com/matomo-org/plugin-AnonymousPiwikUsageMeasurement.git'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the rationale for only doing modified/created is that phpstan will run on everything anyways with the workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants