Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
# Configuration file for PHPStan static code checking, see https://phpstan.org .
|
|
|
|
# PHPStan is triggered on Drupal CI in commit-code-check.sh.
|
|
|
|
includes:
|
2024-03-12 14:41:10 +00:00
|
|
|
- .phpstan-baseline.php
|
2023-01-03 11:51:14 +00:00
|
|
|
- phar://phpstan.phar/conf/bleedingEdge.neon
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
|
|
|
|
parameters:
|
|
|
|
|
2024-07-31 08:16:13 +00:00
|
|
|
tmpDir: phpstan-tmp
|
|
|
|
|
2022-11-07 12:38:24 +00:00
|
|
|
level: 1
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
|
2023-07-29 13:40:49 +00:00
|
|
|
fileExtensions:
|
|
|
|
- sh
|
|
|
|
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
paths:
|
|
|
|
- .
|
|
|
|
- ../composer
|
|
|
|
|
2024-03-03 17:05:28 +00:00
|
|
|
bootstrapFiles:
|
|
|
|
# Load aliases.
|
|
|
|
- lib/Drupal/Core/Serialization/Yaml.php
|
|
|
|
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
excludePaths:
|
2022-11-21 14:57:42 +00:00
|
|
|
# Skip sites directory.
|
|
|
|
- ../sites
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
# Skip test fixtures.
|
2022-04-08 10:10:20 +00:00
|
|
|
- ../*/node_modules/*
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
- */tests/fixtures/*.php
|
2022-01-31 14:45:01 +00:00
|
|
|
- */tests/fixtures/*.php.gz
|
2024-07-31 08:16:13 +00:00
|
|
|
# Skip the phpstan tmpDir
|
|
|
|
- phpstan-tmp/*
|
2024-05-03 16:39:33 +00:00
|
|
|
# Skip Drupal's own PHPStan rules test fixtures.
|
|
|
|
- tests/PHPStan/fixtures/*
|
Issue #3112283 by ravi.shankar, mpdonadio, andregp, daffie, jhedstrom, alexpott, andypost, pifagor, vladbo, JeroenT, voleger, cliddell: Replace REQUEST_TIME in non-OO and non-module code
2022-05-16 16:27:01 +00:00
|
|
|
# Skip Drupal 6 & 7 code.
|
2023-07-29 13:40:49 +00:00
|
|
|
- scripts/dump-database-d?.sh
|
|
|
|
- scripts/generate-d?-content.sh
|
2022-01-31 23:28:30 +00:00
|
|
|
# Skip data files.
|
|
|
|
- lib/Drupal/Component/Transliteration/data/*.php
|
2024-08-01 23:08:11 +00:00
|
|
|
# The following classes deliberately extend non-existent classes for testing.
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
- modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/ExtendingNonInstalledClass.php
|
2023-11-17 12:40:12 +00:00
|
|
|
- modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/custom_annotation/UsingNonInstalledTraitClass.php
|
|
|
|
- modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/custom_annotation/ExtendingNonInstalledClass.php
|
Issue #3178534 by mondrake, klausi, alexpott, longwave, mallezie, Taran2L, mglaman, Spokje, kim.pepper, daffie, andypost, neclimdul, xjm, Gábor Hojtsy, cmlara: Start running PHPStan on Drupal core (level 0)
2022-01-18 09:34:31 +00:00
|
|
|
|
|
|
|
ignoreErrors:
|
|
|
|
# new static() is a best practice in Drupal, so we cannot fix that.
|
|
|
|
- "#^Unsafe usage of new static#"
|
|
|
|
|
|
|
|
# Ignore common errors for now.
|
|
|
|
- "#Drupal calls should be avoided in classes, use dependency injection instead#"
|
|
|
|
- "#^Plugin definitions cannot be altered.#"
|
|
|
|
- "#^Class .* extends @internal class#"
|
2024-05-03 16:39:33 +00:00
|
|
|
|
|
|
|
rules:
|
|
|
|
- Drupal\PHPStan\Rules\ComponentTestDoesNotExtendCoreTest
|