Skip to content

Commit 2c5f21d

Browse files
committed
Align with contributte library specification
- Update Makefile with proper phpcs flags (extensions, tab-width) - Add scanDirectories to PHPStan configuration - Update .editorconfig to match spec format - Simplify .gitignore to match spec - Rename tests/cases to tests/Cases for PSR-4 compliance - Add separate workflow files (phpstan, codesniffer, coverage) - Update tests.yml to use @master workflow reference
1 parent 015a3b3 commit 2c5f21d

File tree

9 files changed

+97
-41
lines changed

9 files changed

+97
-41
lines changed

.editorconfig

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# EditorConfig is awesome: http://EditorConfig.org
2-
31
root = true
42

53
[*]
@@ -8,9 +6,15 @@ end_of_line = lf
86
insert_final_newline = true
97
trim_trailing_whitespace = true
108
indent_style = tab
11-
indent_size = tab
12-
tab_width = 4
9+
indent_size = 4
1310

14-
[{*.json,*.yaml,*.yml,*.md}]
11+
[*.{yml,yaml}]
1512
indent_style = space
1613
indent_size = 2
14+
15+
[*.md]
16+
trim_trailing_whitespace = false
17+
18+
[*.neon]
19+
indent_style = tab
20+
indent_size = 4

.github/workflows/codesniffer.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Codesniffer"
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- "**"
9+
schedule:
10+
- cron: "0 8 * * 1"
11+
12+
jobs:
13+
codesniffer:
14+
name: "Codesniffer"
15+
uses: contributte/.github/.github/workflows/codesniffer.yml@master
16+
with:
17+
php: "8.3"

.github/workflows/coverage.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Coverage"
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- "**"
9+
schedule:
10+
- cron: "0 8 * * 1"
11+
12+
jobs:
13+
coverage:
14+
name: "Nette Tester"
15+
uses: contributte/.github/.github/workflows/nette-tester-coverage-v2.yml@master
16+
with:
17+
php: "8.3"
18+
secrets: inherit

.github/workflows/phpstan.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Phpstan"
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- "**"
9+
schedule:
10+
- cron: "0 8 * * 1"
11+
12+
jobs:
13+
phpstan:
14+
name: "Phpstan"
15+
uses: contributte/.github/.github/workflows/phpstan.yml@master
16+
with:
17+
php: "8.3"

.github/workflows/tests.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests
1+
name: "Nette Tester"
22

33
on:
44
pull_request:
@@ -10,33 +10,33 @@ on:
1010
- cron: "0 8 * * 1"
1111

1212
jobs:
13-
tests85:
14-
name: Tests (PHP 8.5)
15-
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
13+
test85:
14+
name: "Nette Tester"
15+
uses: contributte/.github/.github/workflows/nette-tester.yml@master
1616
with:
1717
php: "8.5"
1818

19-
tests84:
20-
name: Tests (PHP 8.4)
21-
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
19+
test84:
20+
name: "Nette Tester"
21+
uses: contributte/.github/.github/workflows/nette-tester.yml@master
2222
with:
2323
php: "8.4"
2424

25-
tests83:
26-
name: Tests (PHP 8.3)
27-
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
25+
test83:
26+
name: "Nette Tester"
27+
uses: contributte/.github/.github/workflows/nette-tester.yml@master
2828
with:
2929
php: "8.3"
3030

31-
tests82:
32-
name: Tests (PHP 8.2)
33-
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
31+
test82:
32+
name: "Nette Tester"
33+
uses: contributte/.github/.github/workflows/nette-tester.yml@master
3434
with:
3535
php: "8.2"
3636

37-
tests82lowest:
38-
name: Tests (PHP 8.2 - Lowest)
39-
uses: contributte/.github/.github/workflows/nette-tester.yml@v1
37+
testlowest:
38+
name: "Nette Tester Lowest"
39+
uses: contributte/.github/.github/workflows/nette-tester.yml@master
4040
with:
4141
php: "8.2"
42-
composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest"
42+
composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-lowest --prefer-stable"

.gitignore

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
# IDE
2-
/.idea
3-
4-
# Composer
5-
/vendor
6-
/composer.lock
7-
8-
# Tests
9-
/temp
10-
/tests/tmp
11-
/coverage.xml
12-
/coverage.html
1+
/vendor/
2+
/tests/tmp/
3+
composer.lock
4+
coverage.html
5+
coverage.xml

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ qa: phpstan cs
77

88
cs:
99
ifdef GITHUB_ACTION
10-
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp -q --report=checkstyle src tests | cs2pr
10+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions=php,phpt --tab-width=4 -sp src tests --report=checkstyle | cs2pr
1111
else
12-
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests
12+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions=php,phpt --tab-width=4 -sp src tests
1313
endif
1414

1515
csf:
16-
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests
16+
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions=php,phpt --tab-width=4 -sp src tests
1717

1818
phpstan:
1919
vendor/bin/phpstan analyse -c phpstan.neon
2020

2121
tests:
22-
vendor/bin/tester -s -p php --colors 1 -C tests/cases
22+
vendor/bin/tester -s -p php --colors 1 -C tests/Cases
2323

2424
coverage:
2525
ifdef GITHUB_ACTION
26-
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases
26+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
2727
else
28-
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.html --coverage-src ./src tests/cases
28+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases
2929
endif

phpstan.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ includes:
44
parameters:
55
level: 9
66
phpVersion: 80200
7+
8+
scanDirectories:
9+
- src
10+
711
fileExtensions:
812
- php
13+
914
paths:
1015
- src
1116
- .docs
17+
18+
ignoreErrors:

tests/cases/DI/Atlantic18BehaviorExtensionTest.php renamed to tests/Cases/DI/Atlantic18BehaviorExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Tests\cases\DI;
3+
namespace Tests\Cases\DI;
44

55
use Nette\DI\Compiler;
66
use Nette\DI\Container;

0 commit comments

Comments
 (0)