From 37f0bcb959e881f1f859d4a4f7b70f42de05f364 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Thu, 12 Nov 2026 22:59:48 +0100 Subject: [PATCH 1/7] [TASK] Fix yaml lint errors Fixes the errors reported by yamllint with Build/yamllint.yaml, so the yaml lint can be added to the CI. Co-Authored-By: Claude Opus 5.5 --- Build/typoscriptlint.yaml | 2 +- Tests/Fixtures/config/sites/default/config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build/typoscriptlint.yaml b/Build/typoscriptlint.yaml index 12405ea..d48586c 100644 --- a/Build/typoscriptlint.yaml +++ b/Build/typoscriptlint.yaml @@ -16,4 +16,4 @@ sniffs: parameters: commonPathPrefixThreshold: 1 filePatterns: - - "*.typoscript" \ No newline at end of file + - "*.typoscript" diff --git a/Tests/Fixtures/config/sites/default/config.yaml b/Tests/Fixtures/config/sites/default/config.yaml index 9a7ff36..6fd4576 100644 --- a/Tests/Fixtures/config/sites/default/config.yaml +++ b/Tests/Fixtures/config/sites/default/config.yaml @@ -31,4 +31,4 @@ languages: languageId: 2 websiteTitle: '' rootPageId: 1 -websiteTitle: 'Cart Books Test - default' \ No newline at end of file +websiteTitle: 'Cart Books Test - default' From f31e547129d18d80338fded37783e8f53c0e85c9 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Thu, 12 Nov 2026 22:59:49 +0100 Subject: [PATCH 2/7] [TASK] Run yaml lint via Build/Scripts Build/yamllint.yaml existed but was not used since the GitLab CI was removed. Build/Scripts/lint-yaml.sh lints all yaml files except the ones ignored by .gitignore. It is available as composer script project:lint:yaml, as project-lint-yaml in shell.nix and runs in the GitHub CI. The truthy rule no longer checks keys, so the "on" key of GitHub workflows is allowed. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yaml | 12 ++++++++++++ Build/Scripts/lint-yaml.sh | 19 +++++++++++++++++++ Build/yamllint.yaml | 6 +++++- composer.json | 1 + shell.nix | 14 ++++++++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 Build/Scripts/lint-yaml.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ab3a049..aa50326 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,6 +32,18 @@ jobs: - name: PHP lint run: Build/Scripts/lint-php.sh + yaml-linting: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install yamllint + run: pipx install yamllint + + - name: YAML lint + run: Build/Scripts/lint-yaml.sh + coding-guideline: runs-on: ubuntu-latest needs: diff --git a/Build/Scripts/lint-yaml.sh b/Build/Scripts/lint-yaml.sh new file mode 100755 index 0000000..1eaf223 --- /dev/null +++ b/Build/Scripts/lint-yaml.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# +# Lints all yaml files of the extension with yamllint, using +# Build/yamllint.yaml. Files ignored by .gitignore are skipped. +# +# yamllint is not installed via composer. It is provided by shell.nix, in CI it +# is installed via pipx. +# +# Usage: +# Build/Scripts/lint-yaml.sh + +source "$(dirname "${BASH_SOURCE[0]}")/common.sh" + +if ! command -v yamllint > /dev/null; then + echo "Missing yamllint, please install it first, e.g. \"pipx install yamllint\"." >&2 + exit 1 +fi + +yamllint --config-file Build/yamllint.yaml . diff --git a/Build/yamllint.yaml b/Build/yamllint.yaml index 5b0f71b..b8875c1 100644 --- a/Build/yamllint.yaml +++ b/Build/yamllint.yaml @@ -1,5 +1,7 @@ extends: default +ignore-from-file: .gitignore + rules: line-length: disable document-start: disable @@ -20,4 +22,6 @@ rules: forbid-in-block-mappings: true forbid-in-flow-mappings: true indentation: - spaces: 2 \ No newline at end of file + spaces: 2 + truthy: + check-keys: false diff --git a/composer.json b/composer.json index 9106be9..4c51d0f 100644 --- a/composer.json +++ b/composer.json @@ -81,6 +81,7 @@ "project:cgl": "Build/Scripts/cgl.sh", "project:cgl:fix": "Build/Scripts/cgl.sh --fix", "project:lint:php": "Build/Scripts/lint-php.sh", + "project:lint:yaml": "Build/Scripts/lint-yaml.sh", "project:phpstan": "Build/Scripts/phpstan.sh", "project:test:unit": "Build/Scripts/phpunit.sh unit", "project:test:functional": "Build/Scripts/phpunit.sh functional", diff --git a/shell.nix b/shell.nix index 348dfb8..ff5e7a3 100644 --- a/shell.nix +++ b/shell.nix @@ -67,6 +67,18 @@ let ''; }; + projectLintYaml = pkgs.writeShellApplication { + name = "project-lint-yaml"; + + runtimeInputs = [ + pkgs.yamllint + ]; + + text = '' + "$PROJECT_ROOT/Build/Scripts/lint-yaml.sh" + ''; + }; + projectPhpstan = pkgs.writeShellApplication { name = "project-phpstan"; @@ -141,12 +153,14 @@ in pkgs.mkShellNoCC { pkgs.firefox pkgs.geckodriver pkgs.procps + pkgs.yamllint php composer projectInstall projectCgl projectCglFix projectLint + projectLintYaml projectPhpstan projectTestUnit projectTestFunctional From 1014ab093d6a9e3568755c762577a978578cc0bb Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Thu, 12 Nov 2026 23:15:02 +0100 Subject: [PATCH 3/7] [TASK] Fix xml lint errors The XLIFF files are validated against the XLIFF 1.2 strict schema now. They declare XLIFF 1.2 with its namespace, like the TYPO3 core files. Invalid file dates, misspelled attributes and duplicate trans-unit ids are fixed. For duplicate ids the effective (last) label is kept. Co-Authored-By: Claude Opus 5.5 --- Resources/Private/Language/locallang.xlf | 2 +- Resources/Private/Language/locallang_db.xlf | 4 ++-- Resources/Private/Language/locallang_tca.xlf | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index e88a65e..8e863ae 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -1,5 +1,5 @@ - +
diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 8432673..5c10bf2 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -1,6 +1,6 @@ - - + +
diff --git a/Resources/Private/Language/locallang_tca.xlf b/Resources/Private/Language/locallang_tca.xlf index 0fa792d..7f62806 100644 --- a/Resources/Private/Language/locallang_tca.xlf +++ b/Resources/Private/Language/locallang_tca.xlf @@ -1,6 +1,6 @@ - - + +
From 7a0d0db25dd3fe8dd0a32da7a6e4b161c85a7d34 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Thu, 12 Nov 2026 23:15:02 +0100 Subject: [PATCH 4/7] [TASK] Run xml lint via Build/Scripts Build/Scripts/lint-xml.sh validates the XLIFF files against the XLIFF 1.2 strict schema and Build/phpunit.xml.dist against the schema of the installed PHPUnit. Both schemas used for XLIFF are stored in Build/, so the validation does not need to download xml.xsd from w3.org. It is available as composer script project:lint:xml, as project-lint-xml in shell.nix and runs in the GitHub CI. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yaml | 21 + Build/Scripts/lint-xml.sh | 27 + Build/xliff-core-1.2-strict.xsd | 2223 +++++++++++++++++++++++++++++++ Build/xml.xsd | 287 ++++ composer.json | 1 + shell.nix | 14 + 6 files changed, 2573 insertions(+) create mode 100755 Build/Scripts/lint-xml.sh create mode 100644 Build/xliff-core-1.2-strict.xsd create mode 100644 Build/xml.xsd diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index aa50326..d0cdef6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,6 +32,27 @@ jobs: - name: PHP lint run: Build/Scripts/lint-php.sh + xml-linting: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + tools: composer:v2 + + - name: Install xmllint + run: sudo apt-get update && sudo apt-get install -y libxml2-utils + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: XML lint + run: Build/Scripts/lint-xml.sh + yaml-linting: runs-on: ubuntu-latest steps: diff --git a/Build/Scripts/lint-xml.sh b/Build/Scripts/lint-xml.sh new file mode 100755 index 0000000..06b4e08 --- /dev/null +++ b/Build/Scripts/lint-xml.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# Validates the xml files of the extension against their schemas: +# - XLIFF files in Resources/Private/Language against XLIFF 1.2 strict +# (Build/xliff-core-1.2-strict.xsd, imports Build/xml.xsd) +# - Build/phpunit.xml.dist against the schema of the installed PHPUnit +# +# xmllint is not installed via composer. It is provided by shell.nix, in CI it +# is installed via apt (libxml2-utils). +# +# Usage: +# Build/Scripts/lint-xml.sh + +source "$(dirname "${BASH_SOURCE[0]}")/common.sh" + +if ! command -v xmllint > /dev/null; then + echo "Missing xmllint, please install it first, e.g. the package libxml2-utils." >&2 + exit 1 +fi +requireBinary phpunit + +if [ -d Resources/Private/Language ]; then + find Resources/Private/Language -name '*.xlf' -print0 \ + | xargs -0 -r xmllint --schema Build/xliff-core-1.2-strict.xsd --noout +fi + +xmllint --schema .Build/vendor/phpunit/phpunit/phpunit.xsd --noout Build/phpunit.xml.dist diff --git a/Build/xliff-core-1.2-strict.xsd b/Build/xliff-core-1.2-strict.xsd new file mode 100644 index 0000000..b9b2392 --- /dev/null +++ b/Build/xliff-core-1.2-strict.xsd @@ -0,0 +1,2223 @@ + + + + + + + + + + + + + + + Values for the attribute 'context-type'. + + + + + Indicates a database content. + + + + + Indicates the content of an element within an XML document. + + + + + Indicates the name of an element within an XML document. + + + + + Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found. + + + + + Indicates a the number of parameters contained within the <source>. + + + + + Indicates notes pertaining to the parameters in the <source>. + + + + + Indicates the content of a record within a database. + + + + + Indicates the name of a record within a database. + + + + + Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file. + + + + + + + Values for the attribute 'count-type'. + + + + + Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts. + + + + + Indicates the count units are translation units existing already in the same document. + + + + + Indicates a total count. + + + + + + + Values for the attribute 'ctype' when used other elements than <ph> or <x>. + + + + + Indicates a run of bolded text. + + + + + Indicates a run of text in italics. + + + + + Indicates a run of underlined text. + + + + + Indicates a run of hyper-text. + + + + + + + Values for the attribute 'ctype' when used with <ph> or <x>. + + + + + Indicates a inline image. + + + + + Indicates a page break. + + + + + Indicates a line break. + + + + + + + + + + + + Values for the attribute 'datatype'. + + + + + Indicates Active Server Page data. + + + + + Indicates C source file data. + + + + + Indicates Channel Definition Format (CDF) data. + + + + + Indicates ColdFusion data. + + + + + Indicates C++ source file data. + + + + + Indicates C-Sharp data. + + + + + Indicates strings from C, ASM, and driver files data. + + + + + Indicates comma-separated values data. + + + + + Indicates database data. + + + + + Indicates portions of document that follows data and contains metadata. + + + + + Indicates portions of document that precedes data and contains metadata. + + + + + Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import). + + + + + Indicates standard user input screen data. + + + + + Indicates HyperText Markup Language (HTML) data - document instance. + + + + + Indicates content within an HTML document’s <body> element. + + + + + Indicates Windows INI file data. + + + + + Indicates Interleaf data. + + + + + Indicates Java source file data (extension '.java'). + + + + + Indicates Java property resource bundle data. + + + + + Indicates Java list resource bundle data. + + + + + Indicates JavaScript source file data. + + + + + Indicates JScript source file data. + + + + + Indicates information relating to formatting. + + + + + Indicates LISP source file data. + + + + + Indicates information relating to margin formats. + + + + + Indicates a file containing menu. + + + + + Indicates numerically identified string table. + + + + + Indicates Maker Interchange Format (MIF) data. + + + + + Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute. + + + + + Indicates GNU Machine Object data. + + + + + Indicates Message Librarian strings created by Novell's Message Librarian Tool. + + + + + Indicates information to be displayed at the bottom of each page of a document. + + + + + Indicates information to be displayed at the top of each page of a document. + + + + + Indicates a list of property values (e.g., settings within INI files or preferences dialog). + + + + + Indicates Pascal source file data. + + + + + Indicates Hypertext Preprocessor data. + + + + + Indicates plain text file (no formatting other than, possibly, wrapping). + + + + + Indicates GNU Portable Object file. + + + + + Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc. + + + + + Indicates Windows .NET binary resources. + + + + + Indicates Windows .NET Resources. + + + + + Indicates Rich Text Format (RTF) data. + + + + + Indicates Standard Generalized Markup Language (SGML) data - document instance. + + + + + Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD). + + + + + Indicates Scalable Vector Graphic (SVG) data. + + + + + Indicates VisualBasic Script source file. + + + + + Indicates warning message. + + + + + Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file). + + + + + Indicates Extensible HyperText Markup Language (XHTML) data - document instance. + + + + + Indicates Extensible Markup Language (XML) data - document instance. + + + + + Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD). + + + + + Indicates Extensible Stylesheet Language (XSL) data. + + + + + Indicates XUL elements. + + + + + + + Values for the attribute 'mtype'. + + + + + Indicates the marked text is an abbreviation. + + + + + ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept. + + + + + ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective'). + + + + + ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging'). + + + + + ISO-12620: A proper-name term, such as the name of an agency or other proper entity. + + + + + ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another. + + + + + ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language. + + + + + Indicates the marked text is a date and/or time. + + + + + ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign. + + + + + ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form. + + + + + ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula. + + + + + ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record. + + + + + ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy'). + + + + + ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body. + + + + + ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages. + + + + + ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like. + + + + + ISO-12620 2.1.17: A unit to track object. + + + + + Indicates the marked text is a name. + + + + + ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others. + + + + + ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system. + + + + + Indicates the marked text is a phrase. + + + + + ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase. + + + + + Indicates the marked text should not be translated. + + + + + ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet. + + + + + Indicates that the marked text represents a segment. + + + + + ISO-12620 2.1.18.2: A fixed, lexicalized phrase. + + + + + ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs'). + + + + + ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system. + + + + + ISO-12620 2.1.19: A fixed chunk of recurring text. + + + + + ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof. + + + + + ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry. + + + + + ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language. + + + + + Indicates the marked text is a term. + + + + + ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted. + + + + + ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system. + + + + + ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza'). + + + + + ISO-12620 2.1.9: One of the alternate forms of a term. + + + + + + + Values for the attribute 'restype'. + + + + + Indicates a Windows RC AUTO3STATE control. + + + + + Indicates a Windows RC AUTOCHECKBOX control. + + + + + Indicates a Windows RC AUTORADIOBUTTON control. + + + + + Indicates a Windows RC BEDIT control. + + + + + Indicates a bitmap, for example a BITMAP resource in Windows. + + + + + Indicates a button object, for example a BUTTON control Windows. + + + + + Indicates a caption, such as the caption of a dialog box. + + + + + Indicates the cell in a table, for example the content of the <td> element in HTML. + + + + + Indicates check box object, for example a CHECKBOX control in Windows. + + + + + Indicates a menu item with an associated checkbox. + + + + + Indicates a list box, but with a check-box for each item. + + + + + Indicates a color selection dialog. + + + + + Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows. + + + + + Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234). + + + + + Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403). + + + + + Indicates a UI base class element that cannot be represented by any other element. + + + + + Indicates a context menu. + + + + + Indicates a Windows RC CTEXT control. + + + + + Indicates a cursor, for example a CURSOR resource in Windows. + + + + + Indicates a date/time picker. + + + + + Indicates a Windows RC DEFPUSHBUTTON control. + + + + + Indicates a dialog box. + + + + + Indicates a Windows RC DLGINIT resource block. + + + + + Indicates an edit box object, for example an EDIT control in Windows. + + + + + Indicates a filename. + + + + + Indicates a file dialog. + + + + + Indicates a footnote. + + + + + Indicates a font name. + + + + + Indicates a footer. + + + + + Indicates a frame object. + + + + + Indicates a XUL grid element. + + + + + Indicates a groupbox object, for example a GROUPBOX control in Windows. + + + + + Indicates a header item. + + + + + Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML. + + + + + Indicates a Windows RC HEDIT control. + + + + + Indicates a horizontal scrollbar. + + + + + Indicates an icon, for example an ICON resource in Windows. + + + + + Indicates a Windows RC IEDIT control. + + + + + Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF. + + + + + Indicates a label object. + + + + + Indicates a label that is also a HTML link (not necessarily a URL). + + + + + Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML). + + + + + Indicates a listbox object, for example an LISTBOX control in Windows. + + + + + Indicates an list item (an entry in a list). + + + + + Indicates a Windows RC LTEXT control. + + + + + Indicates a menu (a group of menu-items). + + + + + Indicates a toolbar containing one or more tope level menus. + + + + + Indicates a menu item (an entry in a menu). + + + + + Indicates a XUL menuseparator element. + + + + + Indicates a message, for example an entry in a MESSAGETABLE resource in Windows. + + + + + Indicates a calendar control. + + + + + Indicates an edit box beside a spin control. + + + + + Indicates a catch all for rectangular areas. + + + + + Indicates a standalone menu not necessarily associated with a menubar. + + + + + Indicates a pushbox object, for example a PUSHBOX control in Windows. + + + + + Indicates a Windows RC PUSHBUTTON control. + + + + + Indicates a radio button object. + + + + + Indicates a menuitem with associated radio button. + + + + + Indicates raw data resources for an application. + + + + + Indicates a row in a table. + + + + + Indicates a Windows RC RTEXT control. + + + + + Indicates a user navigable container used to show a portion of a document. + + + + + Indicates a generic divider object (e.g. menu group separator). + + + + + Windows accelerators, shortcuts in resource or property files. + + + + + Indicates a UI control to indicate process activity but not progress. + + + + + Indicates a splitter bar. + + + + + Indicates a Windows RC STATE3 control. + + + + + Indicates a window for providing feedback to the users, like 'read-only', etc. + + + + + Indicates a string, for example an entry in a STRINGTABLE resource in Windows. + + + + + Indicates a layers of controls with a tab to select layers. + + + + + Indicates a display and edits regular two-dimensional tables of cells. + + + + + Indicates a XUL textbox element. + + + + + Indicates a UI button that can be toggled to on or off state. + + + + + Indicates an array of controls, usually buttons. + + + + + Indicates a pop up tool tip text. + + + + + Indicates a bar with a pointer indicating a position within a certain range. + + + + + Indicates a control that displays a set of hierarchical data. + + + + + Indicates a URI (URN or URL). + + + + + Indicates a Windows RC USERBUTTON control. + + + + + Indicates a user-defined control like CONTROL control in Windows. + + + + + Indicates the text of a variable. + + + + + Indicates version information about a resource like VERSIONINFO in Windows. + + + + + Indicates a vertical scrollbar. + + + + + Indicates a graphical window. + + + + + + + Values for the attribute 'size-unit'. + + + + + Indicates a size in 8-bit bytes. + + + + + Indicates a size in Unicode characters. + + + + + Indicates a size in columns. Used for HTML text area. + + + + + Indicates a size in centimeters. + + + + + Indicates a size in dialog units, as defined in Windows resources. + + + + + Indicates a size in 'font-size' units (as defined in CSS). + + + + + Indicates a size in 'x-height' units (as defined in CSS). + + + + + Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster' + + + + + Indicates a size in inches. + + + + + Indicates a size in millimeters. + + + + + Indicates a size in percentage. + + + + + Indicates a size in pixels. + + + + + Indicates a size in point. + + + + + Indicates a size in rows. Used for HTML text area. + + + + + + + Values for the attribute 'state'. + + + + + Indicates the terminating state. + + + + + Indicates only non-textual information needs adaptation. + + + + + Indicates both text and non-textual information needs adaptation. + + + + + Indicates only non-textual information needs review. + + + + + Indicates both text and non-textual information needs review. + + + + + Indicates that only the text of the item needs to be reviewed. + + + + + Indicates that the item needs to be translated. + + + + + Indicates that the item is new. For example, translation units that were not in a previous version of the document. + + + + + Indicates that changes are reviewed and approved. + + + + + Indicates that the item has been translated. + + + + + + + Values for the attribute 'state-qualifier'. + + + + + Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously. + + + + + Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.). + + + + + Indicates a match based on matching IDs (in addition to matching text). + + + + + Indicates a translation derived from a glossary. + + + + + Indicates a translation derived from existing translation. + + + + + Indicates a translation derived from machine translation. + + + + + Indicates a translation derived from a translation repository. + + + + + Indicates a translation derived from a translation memory. + + + + + Indicates the translation is suggested by machine translation. + + + + + Indicates that the item has been rejected because of incorrect grammar. + + + + + Indicates that the item has been rejected because it is incorrect. + + + + + Indicates that the item has been rejected because it is too long or too short. + + + + + Indicates that the item has been rejected because of incorrect spelling. + + + + + Indicates the translation is suggested by translation memory. + + + + + + + Values for the attribute 'unit'. + + + + + Refers to words. + + + + + Refers to pages. + + + + + Refers to <trans-unit> elements. + + + + + Refers to <bin-unit> elements. + + + + + Refers to glyphs. + + + + + Refers to <trans-unit> and/or <bin-unit> elements. + + + + + Refers to the occurrences of instances defined by the count-type value. + + + + + Refers to characters. + + + + + Refers to lines. + + + + + Refers to sentences. + + + + + Refers to paragraphs. + + + + + Refers to segments. + + + + + Refers to placeables (inline elements). + + + + + + + Values for the attribute 'priority'. + + + + + Highest priority. + + + + + High priority. + + + + + High priority, but not as important as 2. + + + + + High priority, but not as important as 3. + + + + + Medium priority, but more important than 6. + + + + + Medium priority, but less important than 5. + + + + + Low priority, but more important than 8. + + + + + Low priority, but more important than 9. + + + + + Low priority. + + + + + Lowest priority. + + + + + + + + + This value indicates that all properties can be reformatted. This value must be used alone. + + + + + This value indicates that no properties should be reformatted. This value must be used alone. + + + + + + + + + + + + + This value indicates that all information in the coord attribute can be modified. + + + + + This value indicates that the x information in the coord attribute can be modified. + + + + + This value indicates that the y information in the coord attribute can be modified. + + + + + This value indicates that the cx information in the coord attribute can be modified. + + + + + This value indicates that the cy information in the coord attribute can be modified. + + + + + This value indicates that all the information in the font attribute can be modified. + + + + + This value indicates that the name information in the font attribute can be modified. + + + + + This value indicates that the size information in the font attribute can be modified. + + + + + This value indicates that the weight information in the font attribute can be modified. + + + + + This value indicates that the information in the css-style attribute can be modified. + + + + + This value indicates that the information in the style attribute can be modified. + + + + + This value indicates that the information in the exstyle attribute can be modified. + + + + + + + + + + + + + Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document. + + + + + Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed. + + + + + Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed. + + + + + + + + + Represents a translation proposal from a translation memory or other resource. + + + + + Represents a previous version of the target element. + + + + + Represents a rejected version of the target element. + + + + + Represents a translation to be used for reference purposes only, for example from a related product or a different language. + + + + + Represents a proposed translation that was used for the translation of the trans-unit, possibly modified. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Values for the attribute 'coord'. + + + + + + + + Version values: 1.0 and 1.1 are allowed for backward compatibility. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Build/xml.xsd b/Build/xml.xsd new file mode 100644 index 0000000..aea7d0d --- /dev/null +++ b/Build/xml.xsd @@ -0,0 +1,287 @@ + + + + + + +
+

About the XML namespace

+ +
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + + +
+ +

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+ +
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + +
+ + + + +
+ +

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+ +
+
+
+ + + + + + +
+ + + +
+ +

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+ +

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + + +
+ +

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+ +

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+
+ + + + + + + + + + +
+ +

Father (in any context at all)

+ +
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + + +
+

About this schema document

+ +
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + + +
+

Versioning policy for this schema document

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+ +
+ diff --git a/composer.json b/composer.json index 4c51d0f..536fda3 100644 --- a/composer.json +++ b/composer.json @@ -81,6 +81,7 @@ "project:cgl": "Build/Scripts/cgl.sh", "project:cgl:fix": "Build/Scripts/cgl.sh --fix", "project:lint:php": "Build/Scripts/lint-php.sh", + "project:lint:xml": "Build/Scripts/lint-xml.sh", "project:lint:yaml": "Build/Scripts/lint-yaml.sh", "project:phpstan": "Build/Scripts/phpstan.sh", "project:test:unit": "Build/Scripts/phpunit.sh unit", diff --git a/shell.nix b/shell.nix index ff5e7a3..71916fd 100644 --- a/shell.nix +++ b/shell.nix @@ -67,6 +67,18 @@ let ''; }; + projectLintXml = pkgs.writeShellApplication { + name = "project-lint-xml"; + + runtimeInputs = [ + pkgs.libxml2 + ]; + + text = '' + "$PROJECT_ROOT/Build/Scripts/lint-xml.sh" + ''; + }; + projectLintYaml = pkgs.writeShellApplication { name = "project-lint-yaml"; @@ -153,6 +165,7 @@ in pkgs.mkShellNoCC { pkgs.firefox pkgs.geckodriver pkgs.procps + pkgs.libxml2 pkgs.yamllint php composer @@ -160,6 +173,7 @@ in pkgs.mkShellNoCC { projectCgl projectCglFix projectLint + projectLintXml projectLintYaml projectPhpstan projectTestUnit From f7c9182b1b646efca380f17bd1d461558ac72a45 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Thu, 12 Nov 2026 23:30:08 +0100 Subject: [PATCH 5/7] [TASK] Run TypoScript lint via Build/Scripts Build/Scripts/lint-typoscript.sh lints the TypoScript and TSconfig files in Configuration and Tests with Build/typoscriptlint.yaml and fails on warnings. It is available as composer script project:lint:typoscript, as project-lint-typoscript in shell.nix and runs in the GitHub CI. The content of conditions is indented now, RepeatingRValue is disabled because extracting repeated values into constants would add them to the public configuration of the extension. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ Build/Scripts/lint-typoscript.sh | 21 +++++++++++++++++++++ Build/typoscriptlint.yaml | 9 +++++---- composer.json | 1 + shell.nix | 13 +++++++++++++ 5 files changed, 58 insertions(+), 4 deletions(-) create mode 100755 Build/Scripts/lint-typoscript.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d0cdef6..5f1d544 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,6 +32,24 @@ jobs: - name: PHP lint run: Build/Scripts/lint-php.sh + typoscript-linting: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.2" + tools: composer:v2 + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: TypoScript lint + run: Build/Scripts/lint-typoscript.sh + xml-linting: runs-on: ubuntu-latest steps: diff --git a/Build/Scripts/lint-typoscript.sh b/Build/Scripts/lint-typoscript.sh new file mode 100755 index 0000000..d564292 --- /dev/null +++ b/Build/Scripts/lint-typoscript.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Lints all TypoScript and TSconfig files of the extension with +# helmich/typo3-typoscript-lint, using Build/typoscriptlint.yaml. +# Warnings fail the lint as well. +# +# Usage: +# Build/Scripts/lint-typoscript.sh + +source "$(dirname "${BASH_SOURCE[0]}")/common.sh" + +requireBinary typoscript-lint + +paths=() +for path in Configuration Tests ext_typoscript_setup.typoscript; do + if [ -e "${path}" ]; then + paths+=("${path}") + fi +done + +runPhp "${BIN_DIR}/typoscript-lint" --config Build/typoscriptlint.yaml --fail-on-warnings "${paths[@]}" diff --git a/Build/typoscriptlint.yaml b/Build/typoscriptlint.yaml index d48586c..6b7e404 100644 --- a/Build/typoscriptlint.yaml +++ b/Build/typoscriptlint.yaml @@ -3,13 +3,13 @@ sniffs: parameters: useSpaces: true indentPerLevel: 4 - indentConditions: false + indentConditions: true - class: DeadCode - class: OperatorWhitespace + # Values like validator names or paths are repeated on purpose. Moving them + # to constants would add them to the public configuration of the extension. - class: RepeatingRValue - parameters: - allowedRightValues: - - "TYPO3\\CMS\\Frontend\\DataProcessing\\DatabaseQueryProcessor" + disabled: true - class: DuplicateAssignment - class: EmptySection - class: NestingConsistency @@ -17,3 +17,4 @@ sniffs: commonPathPrefixThreshold: 1 filePatterns: - "*.typoscript" + - "*.tsconfig" diff --git a/composer.json b/composer.json index 536fda3..b08bbc0 100644 --- a/composer.json +++ b/composer.json @@ -81,6 +81,7 @@ "project:cgl": "Build/Scripts/cgl.sh", "project:cgl:fix": "Build/Scripts/cgl.sh --fix", "project:lint:php": "Build/Scripts/lint-php.sh", + "project:lint:typoscript": "Build/Scripts/lint-typoscript.sh", "project:lint:xml": "Build/Scripts/lint-xml.sh", "project:lint:yaml": "Build/Scripts/lint-yaml.sh", "project:phpstan": "Build/Scripts/phpstan.sh", diff --git a/shell.nix b/shell.nix index 71916fd..09b44a3 100644 --- a/shell.nix +++ b/shell.nix @@ -67,6 +67,18 @@ let ''; }; + projectLintTypoScript = pkgs.writeShellApplication { + name = "project-lint-typoscript"; + + runtimeInputs = [ + php + ]; + + text = '' + "$PROJECT_ROOT/Build/Scripts/lint-typoscript.sh" + ''; + }; + projectLintXml = pkgs.writeShellApplication { name = "project-lint-xml"; @@ -173,6 +185,7 @@ in pkgs.mkShellNoCC { projectCgl projectCglFix projectLint + projectLintTypoScript projectLintXml projectLintYaml projectPhpstan From c238db3428e69b3c221d635d80d05d3cad4be6a5 Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Thu, 12 Nov 2026 23:39:26 +0100 Subject: [PATCH 6/7] [TASK] Rename project-lint to project-lint-php The command only lints php files. The new name matches the composer script project:lint:php and the other lint commands. Co-Authored-By: Claude Opus 5.5 --- shell.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shell.nix b/shell.nix index 09b44a3..6cc7917 100644 --- a/shell.nix +++ b/shell.nix @@ -54,8 +54,8 @@ let ''; }; - projectLint = pkgs.writeShellApplication { - name = "project-lint"; + projectLintPhp = pkgs.writeShellApplication { + name = "project-lint-php"; runtimeInputs = [ composer @@ -184,7 +184,7 @@ in pkgs.mkShellNoCC { projectInstall projectCgl projectCglFix - projectLint + projectLintPhp projectLintTypoScript projectLintXml projectLintYaml From 93fc2d91cfe046e60af143e9349b398ca304d42e Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Thu, 12 Nov 2026 23:43:43 +0100 Subject: [PATCH 7/7] [TASK] Add command to run all linters project-lint in shell.nix and the composer script project:lint run the php, TypoScript, xml and yaml lint with one call. Co-Authored-By: Claude Opus 5.5 --- composer.json | 6 ++++++ shell.nix | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/composer.json b/composer.json index b08bbc0..bc5c229 100644 --- a/composer.json +++ b/composer.json @@ -80,6 +80,12 @@ "scripts": { "project:cgl": "Build/Scripts/cgl.sh", "project:cgl:fix": "Build/Scripts/cgl.sh --fix", + "project:lint": [ + "@project:lint:php", + "@project:lint:typoscript", + "@project:lint:xml", + "@project:lint:yaml" + ], "project:lint:php": "Build/Scripts/lint-php.sh", "project:lint:typoscript": "Build/Scripts/lint-typoscript.sh", "project:lint:xml": "Build/Scripts/lint-xml.sh", diff --git a/shell.nix b/shell.nix index 6cc7917..12fd058 100644 --- a/shell.nix +++ b/shell.nix @@ -103,6 +103,24 @@ let ''; }; + projectLint = pkgs.writeShellApplication { + name = "project-lint"; + + runtimeInputs = [ + projectLintPhp + projectLintTypoScript + projectLintXml + projectLintYaml + ]; + + text = '' + project-lint-php + project-lint-typoscript + project-lint-xml + project-lint-yaml + ''; + }; + projectPhpstan = pkgs.writeShellApplication { name = "project-phpstan"; @@ -184,6 +202,7 @@ in pkgs.mkShellNoCC { projectInstall projectCgl projectCglFix + projectLint projectLintPhp projectLintTypoScript projectLintXml