Skip to content

Commit 35dece9

Browse files
committed
feat: initial commit
0 parents  commit 35dece9

22 files changed

+7239
-0
lines changed

.editorconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 4
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
15+
# TS/JS-Files
16+
[*.{ts,js}]
17+
indent_size = 2
18+
19+
# JSON-Files
20+
[*.json]
21+
indent_style = tab
22+
23+
# YAML-Files
24+
[*.{yaml,yml}]
25+
indent_size = 2
26+
27+
# NEON-Files
28+
[*.neon]
29+
indent_size = 2
30+
indent_style = tab

.gitattributes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
* text=auto
2+
/.github export-ignore
3+
/bin export-ignore
4+
/docker export-ignore
5+
/docs/build export-ignore
6+
/docs/hooks.py export-ignore
7+
/tests export-ignore
8+
/.dockerignore export-ignore
9+
/.editorconfig export-ignore
10+
/.gitattributes export-ignore
11+
/.gitignore export-ignore
12+
/.php-cs-fixer.php export-ignore
13+
/codecov.yml export-ignore
14+
/composer.lock export-ignore
15+
/Dockerfile export-ignore
16+
/mkdocs.yml export-ignore
17+
/phpstan.neon export-ignore
18+
/phpunit.xml export-ignore
19+
/phpunit.coverage.xml export-ignore
20+
/renovate.json export-ignore

.github/workflows/cgl.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: CGL
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
7+
jobs:
8+
cgl:
9+
uses: jackd248/reusable-github-actions/.github/workflows/cgl.yml@main

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
# Job: Create release
10+
release:
11+
if: startsWith(github.ref, 'refs/tags/')
12+
runs-on: ubuntu-latest
13+
outputs:
14+
release-notes-url: ${{ steps.create-release.outputs.url }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
# Check if tag is valid
21+
- name: Check tag
22+
run: |
23+
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
24+
exit 1
25+
fi
26+
27+
# Create release
28+
- name: Create release
29+
id: create-release
30+
uses: softprops/action-gh-release@v2
31+
with:
32+
generate_release_notes: true

.github/workflows/tests.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- '**'
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
tests:
12+
13+
name: Test ${{ matrix.name_suffix }}
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php-version: [ "8.1", "8.2", "8.3", "8.4" ]
19+
dependencies: [ "locked", "highest", "lowest" ]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
extensions: libxml, simplexml
30+
tools: composer:${{ matrix.composer_version }}
31+
32+
- name: Install Composer dependencies
33+
run: composer update --no-interaction --no-progress --no-suggest --with=symfony/config:${{ matrix.symfony_constraint }}
34+
35+
- name: Run PHPUnit tests
36+
run: composer test
37+
38+
coverage:
39+
runs-on: ubuntu-latest
40+
name: Code Coverage Report
41+
needs: tests
42+
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Setup PHP
48+
uses: shivammathur/setup-php@v2
49+
with:
50+
php-version: '8.4'
51+
extensions: libxml, simplexml, xdebug
52+
tools: composer:'2.8'
53+
54+
- name: Install Composer dependencies
55+
uses: ramsey/composer-install@v3
56+
57+
- name: Run PHPUnit tests with coverage
58+
run: composer test:coverage
59+
60+
- name: Upload coverage report
61+
uses: actions/upload-artifact@v4
62+
with:
63+
name: code-coverage-report
64+
path: .build/coverage/clover.xml
65+
retention-days: 5
66+
67+
coverage-report:
68+
name: Report test coverage
69+
runs-on: ubuntu-latest
70+
needs: coverage
71+
steps:
72+
- uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0
75+
76+
- name: Download coverage artifact
77+
id: download
78+
uses: actions/download-artifact@v4
79+
with:
80+
name: code-coverage-report
81+
82+
- name: Coveralls report
83+
uses: coverallsapp/github-action@v2
84+
with:
85+
file: ${{ steps.download.outputs.download-path }}/clover.xml

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.idea
2+
/vendor
3+
/.php-cs-fixer.cache
4+
/.phpunit.result.cache
5+
/.build
6+
/php-cs-fixer.xml
7+
/phpstan.xml
8+
/site
9+
/tests/composer.lock
10+
/tests/vendor

.php-cs-fixer.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the Composer package "php-doc-block-header-fixer".
7+
*
8+
* Copyright (C) 2025 Konrad Michalik <hej@konradmichalik.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+
use EliasHaeussler\PhpCsFixerConfig\Config;
25+
use EliasHaeussler\PhpCsFixerConfig\Package;
26+
use EliasHaeussler\PhpCsFixerConfig\Rules;
27+
use Symfony\Component\Finder;
28+
29+
$header = Rules\Header::create(
30+
'php-doc-block-header-fixer',
31+
Package\Type::ComposerPackage,
32+
Package\Author::create('Konrad Michalik', 'hej@konradmichalik.dev'),
33+
Package\CopyrightRange::from(2025),
34+
Package\License::GPL3OrLater,
35+
);
36+
37+
return Config::create()
38+
->withRule($header)
39+
// ->withRule(
40+
// RuleSet::fromArray(
41+
// DocBlockHeader::create(
42+
// [
43+
// 'author' => 'Konrad Michalik <hej@konradmichalik.dev>',
44+
// 'license' => 'GPL-3.0-or-later',
45+
// 'package' => 'PhpDocBlockHeaderFixer',
46+
// ]
47+
// )->__toArray()
48+
// )
49+
// )
50+
// ->registerCustomFixers([new KonradMichalik\PhpDocBlockHeaderFixer\Rules\DocBlockHeaderFixer()]) // Temporarily disabled
51+
->withFinder(static fn (Finder\Finder $finder) => $finder
52+
->in(__DIR__)
53+
->exclude('vendor'),
54+
)
55+
;

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* hej@konradmichalik.dev

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributing
2+
3+
Thank you for considering contributing to this project! Every contribution is welcome and helps improve the quality of the project. To ensure a smooth process and maintain high code quality, please follow the steps below.
4+
5+
## Requirements
6+
7+
- PHP >= 8.2
8+
- Composer >= 2.0
9+
10+
## Preparation
11+
12+
```bash
13+
# Clone repository
14+
git clone https://github.com/move-elevator/composer-translation-validator.git
15+
cd composer-translation-validator
16+
17+
# Install dependencies
18+
composer install
19+
```
20+
21+
## Run linters
22+
23+
```bash
24+
# All linters
25+
composer lint
26+
27+
# Specific linters
28+
composer lint:composer
29+
composer lint:editorconfig
30+
composer lint:php
31+
32+
# Fix all CGL issues
33+
composer fix
34+
35+
# Fix specific CGL issues
36+
composer fix:composer
37+
composer fix:editorconfig
38+
composer fix:php
39+
```
40+
41+
## Run static code analysis
42+
43+
```bash
44+
# All static code analyzers
45+
composer sca
46+
47+
# Specific static code analyzers
48+
composer sca:php
49+
```
50+
51+
## Run tests
52+
53+
```bash
54+
# All tests
55+
composer test
56+
57+
# All tests with code coverage
58+
composer test:coverage
59+
```
60+
61+
### Test reports
62+
63+
Code coverage reports are saved in .build/coverage. You can open the latest HTML report as follows:
64+
65+
```bash
66+
open .build/coverage/html/index.html
67+
```
68+
69+
## Submit a pull request
70+
71+
After completing your work, **open a pull request** and provide a description of your changes. Ideally, your PR should reference an issue that explains the problem you are addressing.
72+
73+
All mentioned code quality tools will run automatically on every pull request for all supported PHP versions. For more details, see the relevant [workflows][1].
74+
75+
[1]: .github/workflows

0 commit comments

Comments
 (0)