Skip to content

Commit 194ba90

Browse files
authored
Add code (#2)
1 parent bd0daff commit 194ba90

83 files changed

Lines changed: 5623 additions & 421 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ trim_trailing_whitespace = true
1010
[*.php]
1111
indent_size = 4
1212

13-
[*.twig]
14-
indent_size = 4
15-
16-
[*.{yaml,yml}]
17-
indent_size = 4
18-
19-
[*.{js,scss,css}]
20-
indent_size = 2
21-
22-
[Jenkinsfile]
23-
indent_size = 2
24-
2513
[*.json]
2614
indent_size = 4
2715

.github/settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ _extends: .github
22

33
repository:
44
name: relazy
5-
description: 👤 Tool for lazy people to create new git releases
5+
description: ⚙️ Tool for lazy people to create new git releases
66
homepage: https://nucleos.rocks
7-
topics: hacktoberfest, symfony, command, release, git, tag
7+
topics: hacktoberfest, symfony, command, release, tag, semantic versioning, version

.gitignore

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
.php-cs-fixer.cache
2-
.php-cs-fixer.php
3-
coverage
4-
composer.lock
5-
phpunit.xml
1+
/.php-cs-fixer.cache
2+
/.php-cs-fixer.php
63
/.phpunit.cache/
4+
/.phpunit.result.cache
5+
/bin
76
/build/
8-
/vendor/
7+
/composer.lock
8+
/phpunit.xml
9+
/vendor-bin/tools/bin/
910
!/vendor-bin/tools/composer.lock
1011
/vendor-bin/tools/vendor/
11-
/vendor-bin/tools/bin/
12+
/vendor/

.php-cs-fixer.dist.php

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<?php
22

3-
$header = <<<EOF
3+
/*
4+
* This file is part of the Relazy package.
5+
*
6+
* (c) Christian Gripp <mail@core23.de>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
$header = <<<'EOF'
413
This file is part of the Relazy package.
514
615
(c) Christian Gripp <mail@core23.de>
@@ -10,19 +19,19 @@
1019
EOF;
1120

1221
$finder = PhpCsFixer\Finder::create()
13-
->in([ __DIR__.'/src', __DIR__.'/tests'])
22+
->in([__DIR__.'/src', __DIR__.'/tests'])
1423
;
1524

16-
$config = (new PhpCsFixer\Config())
25+
return (new PhpCsFixer\Config())
1726
->setRiskyAllowed(true)
1827
->setRules([
19-
'@Symfony' => true,
20-
'@Symfony:risky' => true,
21-
'@PhpCsFixer' => true,
22-
'@PhpCsFixer:risky' => true,
23-
'@PHP70Migration' => true,
28+
'@Symfony' => true,
29+
'@Symfony:risky' => true,
30+
'@PhpCsFixer' => true,
31+
'@PhpCsFixer:risky' => true,
32+
'@PHP70Migration' => true,
2433
'@PHPUnit60Migration:risky' => true,
25-
'header_comment' => [
34+
'header_comment' => [
2635
'header' => $header,
2736
],
2837
'list_syntax' => [
@@ -31,24 +40,28 @@
3140
'binary_operator_spaces' => [
3241
'default' => 'align',
3342
],
34-
'method_chaining_indentation' => false,
43+
'method_chaining_indentation' => false,
44+
'multiline_whitespace_before_semicolons' => [
45+
'strategy' => 'new_line_for_chained_calls',
46+
],
3547
'phpdoc_types_order' => [
3648
'null_adjustment' => 'always_last',
3749
],
38-
'php_unit_internal_class' => false,
50+
'php_unit_internal_class' => false,
3951
'php_unit_test_class_requires_covers' => false,
40-
'no_superfluous_phpdoc_tags' => [
41-
'allow_mixed' => true,
52+
'no_superfluous_phpdoc_tags' => [
53+
'allow_mixed' => true,
4254
'remove_inheritdoc' => true,
4355
],
44-
'static_lambda' => true,
56+
'static_lambda' => true,
4557
'global_namespace_import' => [
46-
'import_classes' => true,
47-
'import_constants' => false,
48-
'import_functions' => false,
58+
'import_classes' => true,
59+
'import_constants' => false,
60+
'import_functions' => false,
61+
],
62+
'phpdoc_to_comment' => [
63+
'ignored_tags' => ['psalm-suppress'],
4964
],
5065
])
5166
->setFinder($finder)
5267
;
53-
54-
return $config;

.relazy.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Relazy package.
5+
*
6+
* (c) Christian Gripp <mail@core23.de>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
use Nucleos\Relazy\Action\Changelog\UpdateAction;
13+
use Nucleos\Relazy\Action\Composer\OutdatedAction;
14+
use Nucleos\Relazy\Action\Composer\StabilityCheckAction;
15+
use Nucleos\Relazy\Action\Composer\ValidateAction;
16+
use Nucleos\Relazy\Action\VersionControl\CommitAction;
17+
use Nucleos\Relazy\Action\VersionControl\CurrentVersionAction;
18+
use Nucleos\Relazy\Action\VersionControl\LastChangesAction;
19+
use Nucleos\Relazy\Changelog\Formatter\PrefixGroupFormatter;
20+
use Nucleos\Relazy\Config\RelazyConfig;
21+
use Nucleos\Relazy\Version\Generator\SemanticGenerator;
22+
use Nucleos\Relazy\Version\Persister\TagPersister;
23+
use Nucleos\Relazy\VersionControl\Git;
24+
25+
return (new RelazyConfig(new Git()))
26+
->versionGenerator(new SemanticGenerator())
27+
->versionPersister(new TagPersister())
28+
->formatter(new PrefixGroupFormatter(
29+
defaultGroup: 'Changed',
30+
groups: ['Feature', 'Enhancement', 'Fixed', 'Translation', 'Changed'],
31+
ignorePrefixes: ['Doc', 'Pedantic']
32+
))
33+
->startupActions([
34+
new ValidateAction(),
35+
new StabilityCheckAction(),
36+
new OutdatedAction(),
37+
new LastChangesAction(),
38+
new CurrentVersionAction(),
39+
])
40+
->preReleaseActions([
41+
new UpdateAction(
42+
file: 'CHANGELOG.MD',
43+
),
44+
new CommitAction(filter: ['CHANGELOG.MD']),
45+
])
46+
;

Makefile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.PHONY: default
2+
default: lint
3+
4+
.PHONY: fix
5+
fix: cs-fix
6+
7+
.PHONY: lint
8+
lint: lint-composer
9+
10+
.PHONY: lint-composer
11+
lint-composer:
12+
composer validate --strict
13+
composer normalize --dry-run
14+
15+
.PHONY: test
16+
test: vendor-bin/tools/vendor
17+
vendor/bin/phpunit --colors=always
18+
19+
.PHONY: infection
20+
infection: vendor/bin/infection
21+
vendor/bin/infection --threads=4
22+
23+
.PHONY: coverage
24+
coverage: vendor-bin/tools/vendor
25+
vendor/bin/phpunit --colors=always --coverage-clover=build/logs/clover.xml
26+
27+
.PHONY: cs
28+
cs: vendor-bin/tools/vendor
29+
vendor/bin/php-cs-fixer fix --verbose --diff --dry-run
30+
31+
.PHONY: cs-fix
32+
cs-fix: vendor-bin/tools/vendor
33+
vendor/bin/php-cs-fixer fix --verbose
34+
35+
.PHONY: psalm
36+
psalm: vendor-bin/tools/vendor
37+
vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4
38+
39+
.PHONY: phpstan
40+
phpstan: vendor-bin/tools/vendor
41+
vendor/bin/phpstan analyse
42+
43+
.PHONY: phpmd
44+
phpmd: vendor-bin/tools/vendor
45+
vendor/bin/phpmd src,tests ansi phpmd.xml
46+
47+
.PHONY: check-dependencies
48+
check-dependencies: vendor-bin/tools/vendor
49+
vendor/bin/composer-require-checker check --config-file composer-require.json composer.json
50+
51+
#
52+
# Installation tasks
53+
#
54+
55+
vendor-bin/tools/vendor:
56+
composer --working-dir=vendor-bin/tools install
57+
58+
vendor/bin/infection: vendor-bin/tools/vendor
59+
wget -O vendor/bin/infection https://github.com/infection/infection/releases/latest/download/infection.phar && chmod +x vendor/bin/infection

0 commit comments

Comments
 (0)