From 2576be4bb2dd2f021669f56bb5b375081b7f1153 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 18 May 2023 19:11:25 +0200 Subject: [PATCH] Adding phan and phpstan to drone setup --- .drone.yml | 20 +++++++++++++++++++- .phan/config.php | 6 ++++-- phpstan.neon | 11 +++++++++++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 phpstan.neon diff --git a/.drone.yml b/.drone.yml index 3b11dbc..92aaf56 100644 --- a/.drone.yml +++ b/.drone.yml @@ -43,6 +43,24 @@ steps: - npx cypress verify - vendor/bin/robo build - curl https://joomla.org/latest -L --output joomla.zip + - mkdir joomla + - cp joomla.zip joomla/joomla.zip + - cd joomla + - unzip joomla.zip + + - name: phan + image: joomlaprojects/docker-images:php8.1-ast + depends: [ prepare_system_tests ] + failure: ignore + commands: + - vendor/bin/phan + + - name: phpstan + image: joomlaprojects/docker-images:php8.1 + depends: [ prepare_system_tests ] + failure: ignore + commands: + - vendor/bin/phpstan analyse src - name: phpmin-system-mysql depends_on: [ prepare_system_tests ] @@ -129,6 +147,6 @@ services: --- kind: signature -hmac: b2d4dd23da55c06ea35eaa184db5172624d15edfa7cdcf5659cce885cd96242b +hmac: ff922cc5122bd7d61d07916ebfb543221a02027839b84132c7366516619adfd5 ... diff --git a/.phan/config.php b/.phan/config.php index 33f9693..bda9b76 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -291,7 +291,8 @@ return [ // should be added to the `directory_list` as well as // to `exclude_analysis_directory_list`. 'exclude_analysis_directory_list' => [ - 'tests/joomla' + 'joomla/administrator/components/com_finder/src/Indexer', + 'joomla/libraries' ], // Enable this to enable checks of require/include statements referring to valid paths. @@ -338,7 +339,8 @@ return [ // your application should be included in this list. 'directory_list' => [ 'src', - 'tests/joomla' + 'joomla/administrator/components/com_finder/src/Indexer', + 'joomla/libraries' ], // A list of individual files to include in analysis diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..5a27c34 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,11 @@ +includes: + - vendor/phpstan/phpstan-deprecation-rules/rules.neon +parameters: + level: 6 + paths: + - src + scanDirectories: + - joomla/libraries + - joomla/administrator/components/com_finder/src/Indexer + ignoreErrors: + reportUnmatchedIgnoredErrors: false