-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Clivern/feature/ci
Feature/ci
- Loading branch information
Showing
53 changed files
with
2,531 additions
and
1,157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd" | ||
backupGlobals="false" | ||
colors="true" | ||
bootstrap="vendor/autoload.php"> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="Project Test Suite"> | ||
<directory>tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/vendor | ||
.phpintel/ | ||
coverage.clover | ||
build/ | ||
index.php | ||
.env | ||
.php_cs.cache | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
$fileHeaderComment = <<<COMMENT | ||
This file is part of the Imap PHP package. | ||
(c) Clivern <[email protected]> | ||
COMMENT; | ||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
->exclude('var') | ||
; | ||
return PhpCsFixer\Config::create() | ||
->setIndent(" ") | ||
->setLineEnding("\n") | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'header_comment' => ['header' => $fileHeaderComment, 'separate' => 'both'], | ||
'linebreak_after_opening_tag' => true, | ||
'mb_str_functions' => true, | ||
'no_php4_constructor' => true, | ||
'no_unreachable_default_argument_value' => true, | ||
'no_useless_else' => true, | ||
'no_useless_return' => true, | ||
'ordered_imports' => true, | ||
'php_unit_strict' => true, | ||
'phpdoc_order' => true, | ||
'semicolon_after_instruction' => true, | ||
'strict_comparison' => true, | ||
'strict_param' => true, | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'ordered_class_elements'=> true, | ||
'phpdoc_types_order' => true, | ||
'logical_operators' => true, | ||
]) | ||
->setFinder($finder) | ||
->setCacheFile(__DIR__.'/.php_cs.cache') | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
COMPOSER ?= composer | ||
PHPUNIT_OPTS = | ||
|
||
|
||
composer: | ||
$(COMPOSER) install | ||
|
||
|
||
fix: | ||
./vendor/bin/php-cs-fixer fix | ||
|
||
|
||
fix-diff: | ||
./vendor/bin/php-cs-fixer fix --diff --dry-run -v | ||
|
||
|
||
test: composer | ||
vendor/bin/phpunit -c . | ||
|
||
|
||
lint: lint-php phpcs php-cs lint-composer lint-eol | ||
@echo All good. | ||
|
||
|
||
lint-eol: | ||
@echo "\n==> Validating unix style line endings of files:files" | ||
@! grep -lIUr --color '^M' src/ composer.json composer.lock || ( echo '[ERROR] Above files have CRLF line endings' && exit 1 ) | ||
@echo All files have valid line endings | ||
|
||
|
||
lint-composer: | ||
@echo "\n==> Validating composer.json and composer.lock:" | ||
$(COMPOSER) validate --strict | ||
|
||
|
||
lint-php: | ||
@echo "\n==> Validating all php files:" | ||
@find src tests -type f -name \*.php | while read file; do php -l "$$file" || exit 1; done | ||
|
||
|
||
phpcs: | ||
vendor/bin/phpcs | ||
|
||
|
||
php-cs: | ||
vendor/bin/php-cs-fixer fix --diff --dry-run -v | ||
|
||
|
||
coverage: composer | ||
vendor/bin/phpunit -c . | ||
|
||
|
||
ci: composer lint test | ||
@echo "All quality checks passed" | ||
|
||
|
||
.PHONY: test composer coverage phpcs php-cs lint lint-php ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.