Skip to content

Commit eff10ff

Browse files
authored
Merge pull request #2852 from tarlepp/chore(tools)/php-parallel-lint
Chore(tools) - Added `php-parallel-lint` tool
2 parents 01df755 + 1978541 commit eff10ff

File tree

6 files changed

+1056
-0
lines changed

6 files changed

+1056
-0
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ jobs:
162162
- name: Run PHPLint tool
163163
run: make phplint
164164

165+
- name: Run PHP Parallel Lint tool
166+
run: make php-parallel-lint
167+
165168
- name: Run Psalm static analysis tool and report statistics to https://shepherd.dev/
166169
run: make psalm-github
167170

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,21 @@ else
354354
$(ALL_DONE)
355355
endif
356356
357+
php-parallel-lint: ## Lint PHP files with `php-parallel-lint`
358+
php-parallel-lint: info_msg := @printf $(_TITLE) "OK" "php-parallel-lint"
359+
php-parallel-lint: info
360+
ifeq ($(INSIDE_DOCKER_CONTAINER), 1)
361+
@./vendor/bin/parallel-lint --exclude .git --exclude app --exclude tools --exclude var --exclude vendor --colors --show-deprecated --blame .
362+
else ifeq ($(RUNNING_SOME_CONTAINERS), 0)
363+
$(WARNING_DOCKER)
364+
else ifneq ($(RUNNING_ALL_CONTAINERS), 1)
365+
$(ERROR_DOCKER)
366+
else
367+
$(NOTICE_HOST)
368+
@HOST_UID=$(HOST_UID) HOST_GID=$(HOST_GID) docker compose exec php make php-parallel-lint
369+
$(ALL_DONE)
370+
endif
371+
357372
psalm: ## Runs Psalm static analysis tool
358373
psalm: info_msg := @printf $(_TITLE) "OK" "Running Psalm - A static analysis tool for PHP"
359374
psalm: info

doc/COMMANDS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ phpinsights # Runs PHP Insights
9999
phplint # Runs PHPLint
100100
phploc # Runs `phploc` and create json output
101101
phpmetrics # Generates PhpMetrics static analysis
102+
php-parallel-lint # Lint PHP files with `php-parallel-lint`
102103
phpstan-github # Runs PHPStan static analysis tool (GitHub)
103104
phpstan # Runs PHPStan static analysis tool
104105
project-stats # Create simple project stats
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "tarlepp/symfony-flex-backend-tools",
3+
"description": "",
4+
"version": "1.0.0",
5+
"require": {
6+
"php": "^8.3.0"
7+
},
8+
"require-dev": {
9+
"php-parallel-lint/php-console-highlighter": "1.0.0",
10+
"php-parallel-lint/php-parallel-lint": "1.4.0",
11+
"roave/security-advisories": "dev-latest"
12+
},
13+
"config": {
14+
"allow-plugins": true,
15+
"platform": {
16+
"php": "8.3.0"
17+
},
18+
"preferred-install": {
19+
"*": "dist"
20+
},
21+
"sort-packages": true
22+
}
23+
}

0 commit comments

Comments
 (0)