Skip to content

Commit 7ca99da

Browse files
committed
Repo: maintenance update (makefile, editorconfig, codeception, codestyle, coveralls)
1 parent 1a177a3 commit 7ca99da

11 files changed

+45
-51
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ indent_style = tab
1111
indent_size = tab
1212
tab_width = 4
1313

14-
[{*.json,*.yml,*.md}]
14+
[{*.json,*.yaml,*.yml,*.md}]
1515
indent_style = space
1616
indent_size = 2

.github/workflows/main.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,7 @@ jobs:
283283

284284
- name: "Coveralls.io"
285285
env:
286-
CI_NAME: github
287-
CI: true
288-
COVERALLS_REPO_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
286+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
289287
run: |
290-
wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
291-
php php-coveralls.phar --verbose --config tests/.coveralls.yml
288+
composer global require php-coveralls/php-coveralls
289+
php-coveralls --coverage_clover=tests/_output/coverage.xml --json_path=coveralls-upload.json -v

Makefile

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
.PHONY: qa lint cs csf phpstan tests coverage
1+
.PHONY: install qa cs csf phpstan tests coverage-clover coverage-html
22

3-
all:
4-
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"}'
5-
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
3+
install:
4+
composer update
65

7-
# QA
6+
qa: phpstan cs
87

9-
qa: lint phpstan cs ## Check code quality - coding style and static analysis
10-
11-
lint: ## Check PHP files syntax
12-
vendor/bin/linter src tests
13-
14-
cs: ## Check PHP files coding style
8+
cs:
9+
ifdef GITHUB_ACTION
10+
vendor/bin/codesniffer -q --report=checkstyle src tests | cs2pr
11+
else
1512
vendor/bin/codesniffer src tests
13+
endif
1614

17-
csf: ## Fix PHP files coding style
15+
csf:
1816
vendor/bin/codefixer src tests
1917

20-
phpstan: ## Analyse code with PHPStan
18+
phpstan:
2119
vendor/bin/phpstan analyse -l max -c phpstan.neon src
2220

23-
# Tests
24-
25-
tests: ## Run all tests
21+
tests:
2622
vendor/bin/codecept build
2723
vendor/bin/codecept run --debug
2824

29-
coverage: ## Generate code coverage in XML format
30-
phpdbg -qrr vendor/bin/phpunit tests --colors=always -c tests/coverage.xml
25+
coverage-clover:
26+
vendor/bin/codecept build
27+
phpdbg -qrr vendor/bin/codecept run --coverage-xml
28+
29+
coverage-html:
30+
vendor/bin/codecept build
31+
phpdbg -qrr vendor/bin/codecept run --coverage-html

codeception.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
actor: Tester
22

33
paths:
4+
# where the tests stored
45
tests: tests
5-
log: tests/_log
6+
7+
# directory for fixture data
68
data: tests/_data
7-
support: tests/_helpers
9+
10+
# directory for support code
11+
support: tests/_support
12+
13+
# directory for output
14+
output: tests/_output
815

916
bootstrap: _bootstrap.php
1017

@@ -14,4 +21,4 @@ settings:
1421
coverage:
1522
enabled: true
1623
include:
17-
- src/*
24+
- src/**

phpstan.neon

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
includes:
2+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
3+
- vendor/phpstan/phpstan-nette/extension.neon
4+
- vendor/phpstan/phpstan-nette/rules.neon
5+
- vendor/phpstan/phpstan-strict-rules/rules.neon
26
- extension.neon
37

48
parameters:
59
excludes_analyse:
6-
- %rootDir%/../../../tests/_*
10+
- %currentWorkingDirectory%/tests/_*
711

812
ignoreErrors:
913
- '#^Only booleans are allowed in a negated boolean, string\|null given.#'

ruleset.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
</rule>
2020

2121
<!-- Exclude folders -->
22-
<exclude-pattern>/tests/tmp</exclude-pattern>
23-
<exclude-pattern>/tests/_helpers</exclude-pattern>
22+
<exclude-pattern>/tests/_output</exclude-pattern>
23+
<exclude-pattern>/tests/_support</exclude-pattern>
24+
<exclude-pattern>/tests/_temp</exclude-pattern>
2425
</ruleset>

src/Module/NetteDIModule.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ private function createContainer(): void
164164

165165
private function getTempDir(): string
166166
{
167-
$tempDir = $this->path . '/' . $this->config['tempDir'];
168-
169-
return $tempDir;
167+
return $this->path . '/' . $this->config['tempDir'];
170168
}
171169

172170

tests/.coveralls.yml

-4
This file was deleted.

tests/.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/_helpers
2-
/_log
1+
/_output
2+
/_support
33
/_temp

tests/coverage.xml

-11
This file was deleted.

tests/functional.suite.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ modules:
77
- Contributte\Codeception\Module\NetteApplicationModule:
88
followRedirects: false
99
- Contributte\Codeception\Module\NetteDIModule:
10-
tempDir: ../_temp/functional
10+
tempDir: ./../_temp/functional
1111
removeDefaultExtensions: true
1212
configFiles:
1313
- config/config.neon

0 commit comments

Comments
 (0)