From 5f51604f14aff70d27db05923afdf1ebc47fb4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Uzna=C5=84ski?= Date: Fri, 15 Dec 2023 16:17:39 +0100 Subject: [PATCH] [TASK] Add xliff linting locally (#1071) Resolves: #346 --- .github/dependabot.yml | 2 ++ .github/workflows/ci.yml | 9 +-------- Build/bin/console | 14 ++++++++++++++ CHANGELOG.md | 1 + composer.json | 4 ++++ 5 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 Build/bin/console diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9566b02..f62a48c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -18,6 +18,8 @@ updates: - dependency-name: "doctrine/dbal" - dependency-name: "phpunit/phpunit" versions: [ "^10.0" ] + - dependency-name: "symfony/console" + - dependency-name: "symfony/translation" - dependency-name: "symfony/yaml" - dependency-name: "typo3/cms-*" versioning-strategy: "increase" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08eaad0..7083982 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,7 @@ jobs: - "php:stan" - "ts:lint" - "yaml:lint" + - "xliff:lint" php-version: - "8.1" code-quality-frontend: @@ -93,14 +94,6 @@ jobs: run: yarn - name: "Run command" run: "yarn lint:${{ matrix.command }}" - xliff-lint: - name: "Xliff linter" - runs-on: ubuntu-22.04 - steps: - - name: "Checkout" - uses: actions/checkout@v4 - - name: "Run the xliff lint" - uses: TYPO3-Continuous-Integration/TYPO3-CI-Xliff-Lint@v1 unit-tests: name: "Unit tests" runs-on: ubuntu-22.04 diff --git a/Build/bin/console b/Build/bin/console new file mode 100644 index 0000000..08b74be --- /dev/null +++ b/Build/bin/console @@ -0,0 +1,14 @@ +#!/usr/bin/env php +add(new XliffLintCommand(null, null, null, false)); +$application->add(new LintCommand()); + +exit($application->run()); diff --git a/CHANGELOG.md b/CHANGELOG.md index 66a6bfa..a8da584 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## x.y.z ### Added +- Add Composer script for XLIFF linting (#1071) - Add polish translation for tea (#1020) - Make records timeable and hideable (#989) - Add support for PHP 8.3 (#965) diff --git a/composer.json b/composer.json index 9bec9f0..0950f32 100644 --- a/composer.json +++ b/composer.json @@ -59,6 +59,8 @@ "saschaegerer/phpstan-typo3": "^1.9.1", "seld/jsonlint": "^1.10.0", "squizlabs/php_codesniffer": "^3.8.0", + "symfony/console": "^5.4 || ^6.4", + "symfony/translation": "^5.4 || ^6.4", "symfony/yaml": "^5.3.6 || ^6.2.0", "tomasvotruba/type-coverage": "^0.2.1", "typo3/cms-fluid-styled-content": "^11.5.4 || ^12.4.0", @@ -154,6 +156,7 @@ ], "ci:tests:unit": ".Build/bin/phpunit -c ./Tests/Unit/UnitTests.xml Tests/Unit", "ci:ts:lint": "typoscript-lint -c Configuration/TsLint.yml --ansi -n --fail-on-warnings -vvv Configuration/TypoScript", + "ci:xliff:lint": "php Build/bin/console lint:xliff Resources/Private/Language", "ci:yaml:lint": "find . ! -path '*.Build/*' ! -path '*node_modules/*' -regextype egrep -regex '.*.ya?ml$' | xargs -r php ./.Build/bin/yaml-lint", "coverage:create-directories": "mkdir -p .Build/logs .Build/coverage", "docs:generate": [ @@ -212,6 +215,7 @@ "ci:tests:functional": "Runs the functional tests.", "ci:tests:unit": "Runs the unit tests.", "ci:ts:lint": "Lints the TypoScript files.", + "ci:xliff:lint": "Lints the XLIFF files.", "ci:yaml:lint": "Lints the YAML files.", "coverage:create-directories": "Creates the directories needed for recording and merging the code coverage reports.", "docs:generate": "Renders the extension ReST documentation.",