• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eliashaeussler / version-bumper / 12736929692

12 Jan 2025 08:41PM UTC coverage: 89.556% (-0.03%) from 89.583%
12736929692

Pull #22

github

web-flow
Merge b92b4061b into 8a900f274
Pull Request #22: [FEATURE] Provide config preset for TYPO3 commit guidelines

32 of 36 new or added lines in 1 file covered. (88.89%)

806 of 900 relevant lines covered (89.56%)

3.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/src/Config/Preset/Typo3CommitGuidelinesPreset.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the Composer package "eliashaeussler/version-bumper".
7
 *
8
 * Copyright (C) 2024-2025 Elias Häußler <elias@haeussler.dev>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 3 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace EliasHaeussler\VersionBumper\Config\Preset;
25

26
use EliasHaeussler\VersionBumper\Config;
27
use EliasHaeussler\VersionBumper\Enum;
28

29
/**
30
 * Typo3CommitGuidelinesPreset.
31
 *
32
 * @author Elias Häußler <elias@haeussler.dev>
33
 * @license GPL-3.0-or-later
34
 *
35
 * @see https://docs.typo3.org/m/typo3/guide-contributionworkflow/main/en-us/Appendix/CommitMessage.html
36
 */
37
final class Typo3CommitGuidelinesPreset implements Preset
38
{
39
    /* @phpstan-ignore constructor.unusedParameter */
40
    public function __construct(array $options = []) {}
1✔
41

42
    public function getConfig(): Config\VersionBumperConfig
1✔
43
    {
44
        $versionRangeIndicators = [
1✔
45
            // Major
46
            new Config\VersionRangeIndicator(
1✔
47
                Enum\VersionRange::Major,
1✔
48
                [
1✔
49
                    new Config\VersionRangePattern(
1✔
50
                        Enum\VersionRangeIndicatorType::CommitMessage,
1✔
51
                        '/^\[!!!]/',
1✔
52
                    ),
1✔
53
                ],
1✔
54
            ),
1✔
55

56
            // Minor
57
            new Config\VersionRangeIndicator(
1✔
58
                Enum\VersionRange::Minor,
1✔
59
                [
1✔
60
                    new Config\VersionRangePattern(
1✔
61
                        Enum\VersionRangeIndicatorType::CommitMessage,
1✔
62
                        '/^\[FEATURE]/',
1✔
63
                    ),
1✔
64
                ],
1✔
65
            ),
1✔
66

67
            // Patch
68
            new Config\VersionRangeIndicator(
1✔
69
                Enum\VersionRange::Patch,
1✔
70
                [
1✔
71
                    new Config\VersionRangePattern(
1✔
72
                        Enum\VersionRangeIndicatorType::CommitMessage,
1✔
73
                        '/^\[(BUGFIX|DOCS|TASK)]/',
1✔
74
                    ),
1✔
75
                ],
1✔
76
            ),
1✔
77
        ];
1✔
78

79
        return new Config\VersionBumperConfig(versionRangeIndicators: $versionRangeIndicators);
1✔
80
    }
81

NEW
82
    public static function getIdentifier(): string
×
83
    {
NEW
84
        return 'typo3-commit-guidelines';
×
85
    }
86

NEW
87
    public static function getDescription(): string
×
88
    {
NEW
89
        return 'TYPO3 guidelines for commit messages';
×
90
    }
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc