Skip to content

Commit

Permalink
Add code
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Jul 4, 2023
1 parent bd0daff commit 28ab551
Show file tree
Hide file tree
Showing 83 changed files with 5,623 additions and 421 deletions.
12 changes: 0 additions & 12 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ trim_trailing_whitespace = true
[*.php]
indent_size = 4

[*.twig]
indent_size = 4

[*.{yaml,yml}]
indent_size = 4

[*.{js,scss,css}]
indent_size = 2

[Jenkinsfile]
indent_size = 2

[*.json]
indent_size = 4

Expand Down
4 changes: 2 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ _extends: .github

repository:
name: relazy
description: 👤 Tool for lazy people to create new git releases
description: ⚙️ Tool for lazy people to create new git releases
homepage: https://nucleos.rocks
topics: hacktoberfest, symfony, command, release, git, tag
topics: hacktoberfest, symfony, command, release, tag, semantic versioning, version
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.php-cs-fixer.cache
.php-cs-fixer.php
coverage
composer.lock
phpunit.xml
/.php-cs-fixer.cache
/.php-cs-fixer.php
/.phpunit.cache/
/.phpunit.result.cache
/bin
/build/
/vendor/
/composer.lock
/phpunit.xml
/vendor-bin/tools/bin/
!/vendor-bin/tools/composer.lock
/vendor-bin/tools/vendor/
/vendor-bin/tools/bin/
/vendor/
51 changes: 32 additions & 19 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<?php

$header = <<<EOF
/*
* This file is part of the Relazy package.
*
* (c) Christian Gripp <mail@core23.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$header = <<<'EOF'
This file is part of the Relazy package.
(c) Christian Gripp <mail@core23.de>
Expand All @@ -10,19 +19,19 @@
EOF;

$finder = PhpCsFixer\Finder::create()
->in([ __DIR__.'/src', __DIR__.'/tests'])
->in([__DIR__.'/src', __DIR__.'/tests'])
;

$config = (new PhpCsFixer\Config())
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHP70Migration' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'@PhpCsFixer' => true,
'@PhpCsFixer:risky' => true,
'@PHP70Migration' => true,
'@PHPUnit60Migration:risky' => true,
'header_comment' => [
'header_comment' => [
'header' => $header,
],
'list_syntax' => [
Expand All @@ -31,24 +40,28 @@
'binary_operator_spaces' => [
'default' => 'align',
],
'method_chaining_indentation' => false,
'method_chaining_indentation' => false,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'new_line_for_chained_calls',
],
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
],
'php_unit_internal_class' => false,
'php_unit_internal_class' => false,
'php_unit_test_class_requires_covers' => false,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
'remove_inheritdoc' => true,
],
'static_lambda' => true,
'static_lambda' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => false,
'import_functions' => false,
'import_classes' => true,
'import_constants' => false,
'import_functions' => false,
],
'phpdoc_to_comment' => [
'ignored_tags' => ['psalm-suppress'],
],
])
->setFinder($finder)
;

return $config;
46 changes: 46 additions & 0 deletions .relazy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

/*
* This file is part of the Relazy package.
*
* (c) Christian Gripp <mail@core23.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Nucleos\Relazy\Action\Changelog\UpdateAction;
use Nucleos\Relazy\Action\Composer\OutdatedAction;
use Nucleos\Relazy\Action\Composer\StabilityCheckAction;
use Nucleos\Relazy\Action\Composer\ValidateAction;
use Nucleos\Relazy\Action\VersionControl\CommitAction;
use Nucleos\Relazy\Action\VersionControl\CurrentVersionAction;
use Nucleos\Relazy\Action\VersionControl\LastChangesAction;
use Nucleos\Relazy\Changelog\Formatter\PrefixGroupFormatter;
use Nucleos\Relazy\Config\RelazyConfig;
use Nucleos\Relazy\Version\Generator\SemanticGenerator;
use Nucleos\Relazy\Version\Persister\TagPersister;
use Nucleos\Relazy\VersionControl\Git;

return (new RelazyConfig(new Git()))
->versionGenerator(new SemanticGenerator())
->versionPersister(new TagPersister())
->formatter(new PrefixGroupFormatter(
defaultGroup: 'Changed',
groups: ['Feature', 'Enhancement', 'Fixed', 'Translation', 'Changed'],
ignorePrefixes: ['Doc', 'Pedantic']
))
->startupActions([
new ValidateAction(),
new StabilityCheckAction(),
new OutdatedAction(),
new LastChangesAction(),
new CurrentVersionAction(),
])
->preReleaseActions([
new UpdateAction(
file: 'CHANGELOG.MD',
),
new CommitAction(filter: ['CHANGELOG.MD']),
])
;
59 changes: 59 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.PHONY: default
default: lint

.PHONY: fix
fix: cs-fix

.PHONY: lint
lint: lint-composer

.PHONY: lint-composer
lint-composer:
composer validate --strict
composer normalize --dry-run

.PHONY: test
test: vendor-bin/tools/vendor
vendor/bin/phpunit --colors=always

.PHONY: infection
infection: vendor/bin/infection
vendor/bin/infection --threads=4

.PHONY: coverage
coverage: vendor-bin/tools/vendor
vendor/bin/phpunit --colors=always --coverage-clover=build/logs/clover.xml

.PHONY: cs
cs: vendor-bin/tools/vendor
vendor/bin/php-cs-fixer fix --verbose --diff --dry-run

.PHONY: cs-fix
cs-fix: vendor-bin/tools/vendor
vendor/bin/php-cs-fixer fix --verbose

.PHONY: psalm
psalm: vendor-bin/tools/vendor
vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4

.PHONY: phpstan
phpstan: vendor-bin/tools/vendor
vendor/bin/phpstan analyse

.PHONY: phpmd
phpmd: vendor-bin/tools/vendor
vendor/bin/phpmd src,tests ansi phpmd.xml

.PHONY: check-dependencies
check-dependencies: vendor-bin/tools/vendor
vendor/bin/composer-require-checker check --config-file composer-require.json composer.json

#
# Installation tasks
#

vendor-bin/tools/vendor:
composer --working-dir=vendor-bin/tools install

vendor/bin/infection: vendor-bin/tools/vendor
wget -O vendor/bin/infection https://github.com/infection/infection/releases/latest/download/infection.phar && chmod +x vendor/bin/infection
Loading

0 comments on commit 28ab551

Please sign in to comment.