make phpstan & watcher happy, stop running phpstan on vendor/
This commit is contained in:
parent
cdd7ad020e
commit
62ca093b75
|
@ -3,11 +3,11 @@
|
|||
"tasks": [
|
||||
{
|
||||
"type": "shell",
|
||||
"label": "phpstan 8.1 (watcher)",
|
||||
"label": "phpstan (watcher)",
|
||||
"isBackground": true,
|
||||
"problemMatcher": {
|
||||
"fileLocation": ["relative", "${workspaceRoot}"],
|
||||
"owner": "phpstan-watcher-8.1",
|
||||
"owner": "phpstan-watcher",
|
||||
"pattern": {
|
||||
"regexp": "^/app/(.*?):([0-9\\?]*):(.*)$",
|
||||
"file": 1,
|
||||
|
|
|
@ -11,6 +11,8 @@ use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
|
|||
class Tracer {
|
||||
/** @var Tracer $instance */
|
||||
private static $instance;
|
||||
|
||||
/** @var OpenTelemetry\API\Trace\TracerInterface $tracer */
|
||||
private static $tracer;
|
||||
|
||||
public function __construct() {
|
||||
|
@ -44,7 +46,7 @@ class Tracer {
|
|||
* @param string $name
|
||||
* @param array<string>|array<string, array<string, mixed>> $tags
|
||||
* @param array<string> $args
|
||||
* @return Span
|
||||
* @return OpenTelemetry\API\Trace\SpanInterface
|
||||
*/
|
||||
private function _start(string $name, array $tags = [], array $args = []) {
|
||||
$span = $this->tracer->spanBuilder($name)->startSpan();
|
||||
|
@ -64,7 +66,7 @@ class Tracer {
|
|||
* @param string $name
|
||||
* @param array<string>|array<string, array<string, mixed>> $tags
|
||||
* @param array<string> $args
|
||||
* @return Span
|
||||
* @return OpenTelemetry\API\Trace\SpanInterface
|
||||
*/
|
||||
public static function start(string $name, array $tags = [], array $args = []) {
|
||||
return self::get_instance()->_start($name, $tags, $args);
|
||||
|
@ -76,5 +78,4 @@ class Tracer {
|
|||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,8 +28,6 @@ parameters:
|
|||
- plugins/**/tests/*
|
||||
- plugins/*/vendor/intervention/*
|
||||
- plugins/*/vendor/psr/log/*
|
||||
- vendor/**/test/*
|
||||
- vendor/**/tests/*
|
||||
- vendor/sebastian/*
|
||||
- vendor/**/*
|
||||
paths:
|
||||
- .
|
||||
|
|
|
@ -1,19 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
PHP_VERSION="$1"
|
||||
|
||||
[ -z "$PHP_VERSION" ] && PHP_VERSION=8.1
|
||||
|
||||
echo PHP_VERSION: ${PHP_VERSION}
|
||||
echo PWD: $(pwd)
|
||||
|
||||
while true; do
|
||||
inotifywait . -e close_write -r -t 300 | grep -q .php && \
|
||||
(
|
||||
MODIFIED=$(git ls-files -m | grep .php)
|
||||
|
||||
docker run --rm -v $(pwd):/app -v /tmp/phpstan-8.1:/tmp/phpstan \
|
||||
--workdir /app registry.fakecake.org/cthulhoo/ci-alpine:3.16 php81 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G --error-format=raw analyze ${MODIFIED}
|
||||
--workdir /app registry.fakecake.org/ci/php8.2-alpine:3.18 php82 -d memory_limit=-1 ./vendor/bin/phpstan --memory-limit=2G --error-format=raw analyze ${MODIFIED}
|
||||
echo All done, RC=$?.
|
||||
)
|
||||
sleep 1
|
||||
|
|
Loading…
Reference in New Issue