-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(MPK-83): Add validation command (#1)
* feat(MPK-83): Add validation command * Create LICENSE * feat(MPK-83): Add docker and phpspec * feat(MPK-83): Add basic tests, phpcs and static analysis * feat(MPK-83): Fix static analysis * feat(MPK-83): Coverage is 100.00% - OK! * feat(MPK-83): Add command note to readme * feat(MPK-83): Fix interpreter line Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Better namespace for bin file Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Add infection testing Signed-off-by: TiMESPLiNTER <[email protected]> * add circle config * Apply suggestions from code review * add shadow * fix circle * fix docker * feat(MPK-83): Add some more types Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Fix static analysis and coverage Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Fix coverage Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Added test for union type with sub schemas Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Added support for union type with sub schemas Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Improved handling of inlined schemas Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Make Stan happy Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Adjust MSIs 😏 Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Fix type determination Signed-off-by: TiMESPLiNTER <[email protected]> * feat(MPK-83): Make Stan happy again Signed-off-by: TiMESPLiNTER <[email protected]> Co-authored-by: Nick <[email protected]>
- Loading branch information
1 parent
7fc496d
commit bd72ef1
Showing
36 changed files
with
5,194 additions
and
60 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,36 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
ci-caching: jobcloud/[email protected] | ||
ci-php: jobcloud/[email protected] | ||
|
||
workflows: | ||
test-avro-validator: | ||
jobs: | ||
- ci-caching/build-docker-images: | ||
dockerComposeFile: "./docker/docker-compose.yml" | ||
- ci-php/install-dependencies: | ||
dockerComposeFile: "./docker/docker-compose.yml" | ||
dependencyCheckSumFile: "./composer.json" | ||
requires: | ||
- ci-caching/build-docker-images | ||
- ci-php/coverage: | ||
dockerComposeFile: "./docker/docker-compose.yml" | ||
dependencyCheckSumFile: "./composer.json" | ||
requires: | ||
- ci-php/install-dependencies | ||
- ci-php/code-style: | ||
dockerComposeFile: "./docker/docker-compose.yml" | ||
dependencyCheckSumFile: "./composer.json" | ||
requires: | ||
- ci-php/install-dependencies | ||
- ci-php/static-analysis: | ||
dockerComposeFile: "./docker/docker-compose.yml" | ||
dependencyCheckSumFile: "./composer.json" | ||
requires: | ||
- ci-php/install-dependencies | ||
- ci-php/infection-testing: | ||
dockerComposeFile: "./docker/docker-compose.yml" | ||
dependencyCheckSumFile: "./composer.json" | ||
requires: | ||
- ci-php/install-dependencies |
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,2 +1,3 @@ | ||
.idea/ | ||
vendor/ | ||
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 JobCloud AG | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 @@ | ||
.PHONY: clean code-style coverage help test test-unit test-integration static-analysis infection-testing install-dependencies update-dependencies | ||
.DEFAULT_GOAL := help | ||
|
||
PHPSPEC = ./vendor/bin/phpspec run --format dot -vvv -c phpspec.yml | ||
PHPSTAN = ./vendor/bin/phpstan | ||
PHPCS = ./vendor/bin/phpcs --extensions=php | ||
INFECTION = ./vendor/bin/infection | ||
CONSOLE = ./bin/console | ||
|
||
clean: | ||
rm -rf ./build ./vendor | ||
|
||
fix-code-style: | ||
${PHPCBF} | ||
|
||
code-style: | ||
mkdir -p build/logs/phpcs | ||
${PHPCS} | ||
|
||
coverage: | ||
mkdir -p build/logs/phpspec/coverage | ||
php -dpcov.enabled=1 -dpcov.directory=./src ${PHPSPEC} | ||
./vendor/bin/coverage-check build/logs/phpspec/coverage/coverage.xml 98 | ||
|
||
test: test-unit test-integration | ||
|
||
test-unit: | ||
${PHPSPEC} --no-coverage | ||
|
||
infection-testing: | ||
make coverage | ||
cp -f build/logs/phpspec/coverage/xml/index.xml build/logs/phpspec/coverage/junit.xml | ||
${INFECTION} --test-framework=phpspec --only-covered --coverage=build/logs/phpspec/coverage --min-msi=88 --threads=`nproc` | ||
|
||
static-analysis: | ||
${PHPSTAN} analyse src --no-progress | ||
|
||
install-dependencies: | ||
composer install | ||
|
||
update-dependencies: | ||
composer update | ||
|
||
help: | ||
# Usage: | ||
# make <target> [OPTION=value] | ||
# | ||
# Targets: | ||
# clean Cleans the coverage and the vendor directory | ||
# code-style Check code style using phpcs | ||
# coverage Generate code coverage (html, clover) | ||
# help You're looking at it! | ||
# test (default) Run all the tests | ||
# test-unit Run the unit tests with phpspec | ||
# static-analysis Run static analysis using phpstan | ||
# install-dependencies Run composer install | ||
# update-dependencies Run composer update |
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,19 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Jobcloud\Avro\Validator\Bin; | ||
|
||
use Jobcloud\Avro\Validator\Command\ValidateCommand; | ||
use Symfony\Component\Console\Application; | ||
use Symfony\Component\Console\Input\ArgvInput; | ||
use Symfony\Component\Console\Output\ConsoleOutput; | ||
|
||
require __DIR__ . '/../vendor/autoload.php'; | ||
|
||
$app = new Application('Avro validator', '1.0'); | ||
|
||
$app->add(new ValidateCommand()); | ||
|
||
$app->run(new ArgvInput(), new ConsoleOutput()); |
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,8 +1,27 @@ | ||
{ | ||
"name": "jobcloud/avro-validator", | ||
"license": "MIT", | ||
"require": { | ||
"php": ">=7.3", | ||
"ext-json": "*", | ||
"symfony/console": "^5.1.5" | ||
}, | ||
"require-dev": { | ||
"ergebnis/phpstan-rules": "^0.14.3", | ||
"friends-of-phpspec/phpspec-code-coverage": "dev-master@dev", | ||
"phpspec/phpspec": "^6.2.1", | ||
"phpstan/phpstan": "^0.12.11", | ||
"phpstan/phpstan-deprecation-rules": "^0.12.2", | ||
"phpstan/phpstan-strict-rules": "^0.12.2", | ||
"rregeer/phpunit-coverage-check": "^0.3.1", | ||
"squizlabs/php_codesniffer": "^3.4.2", | ||
"infection/infection": "^0.17", | ||
"infection/phpspec-adapter": "^0.1.1" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Jobcloud\\Avro\\Validator\\": "src/" | ||
} | ||
} | ||
}, | ||
"bin": ["bin/avro-validator"] | ||
} |
Oops, something went wrong.