diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f39815d5..4ee525bd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,6 +32,57 @@ 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: + - 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: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install yamllint + run: pipx install yamllint + + - name: YAML lint + run: Build/Scripts/lint-yaml.sh + documentation-rendering: runs-on: ubuntu-latest steps: diff --git a/Build/Scripts/lint-typoscript.sh b/Build/Scripts/lint-typoscript.sh new file mode 100755 index 00000000..d5642920 --- /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/Scripts/lint-xml.sh b/Build/Scripts/lint-xml.sh new file mode 100755 index 00000000..06b4e087 --- /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/Scripts/lint-yaml.sh b/Build/Scripts/lint-yaml.sh new file mode 100755 index 00000000..1eaf2232 --- /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/typoscriptlint.yaml b/Build/typoscriptlint.yaml index 12405ea9..6b7e4049 100644 --- a/Build/typoscriptlint.yaml +++ b/Build/typoscriptlint.yaml @@ -3,17 +3,18 @@ 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 parameters: commonPathPrefixThreshold: 1 filePatterns: - - "*.typoscript" \ No newline at end of file + - "*.typoscript" + - "*.tsconfig" diff --git a/Build/xliff-core-1.2-strict.xsd b/Build/xliff-core-1.2-strict.xsd new file mode 100644 index 00000000..b9b23924 --- /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 00000000..aea7d0db --- /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/Build/yamllint.yaml b/Build/yamllint.yaml index 5b0f71b9..b8875c10 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/Configuration/TypoScript/constants.typoscript b/Configuration/TypoScript/constants.typoscript index 78d0baff..ce4ed47d 100755 --- a/Configuration/TypoScript/constants.typoscript +++ b/Configuration/TypoScript/constants.typoscript @@ -21,12 +21,12 @@ plugin.tx_cartproducts { } format.currency { - currencySign = € - decimalSeparator = , + currencySign = € + decimalSeparator = , thousandsSeparator = . - prependCurrency = false - separateCurrency = true - decimals = 2 + prependCurrency = false + separateCurrency = true + decimals = 2 } } } diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index ac91500d..3be24bdf 100755 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -27,12 +27,18 @@ plugin.tx_cartproducts { media { image { size { - small.maxWidth = 100 - small.maxHeight = - medium.maxWidth = 300 - medium.maxHeight = - large.maxWidth = 600 - large.maxHeight = + small { + maxWidth = 100 + maxHeight = + } + medium { + maxWidth = 300 + maxHeight = + } + large { + maxWidth = 600 + maxHeight = + } } } } @@ -42,30 +48,34 @@ plugin.tx_cartproducts { } } -lib.cartProduct = COA -lib.cartProduct.showForm = USER -lib.cartProduct.showForm { - userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run - vendorName = Extcode - extensionName = CartProducts - pluginName = ProductPartial +lib { + cartProduct = COA + cartProduct { + showForm = USER + showForm { + userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run + vendorName = Extcode + extensionName = CartProducts + pluginName = ProductPartial - controller = Product - action = showForm + controller = Product + action = showForm - product = TEXT - product.value.dataWrap = {field: productUid} + product = TEXT + product.value.dataWrap = {field: productUid} - settings =< plugin.tx_cartproducts.settings - persistence =< plugin.tx_cartproducts.persistence - view =< plugin.tx_cartproducts.view - update =< plugin.tx_cartproducts.update -} + settings =< plugin.tx_cartproducts.settings + persistence =< plugin.tx_cartproducts.persistence + view =< plugin.tx_cartproducts.view + update =< plugin.tx_cartproducts.update + } + } -lib.renderContent = RECORDS -lib.renderContent { - source.current = 1 - tables = tt_content - dontCheckPid = 1 - conf.tt_content =< tt_content + renderContent = RECORDS + renderContent { + source.current = 1 + tables = tt_content + dontCheckPid = 1 + conf.tt_content =< tt_content + } } diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 0eb07597..524e55fe 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -1,5 +1,5 @@ - +
diff --git a/Resources/Private/Language/locallang_be.xlf b/Resources/Private/Language/locallang_be.xlf index 35223d05..60748ea2 100644 --- a/Resources/Private/Language/locallang_be.xlf +++ b/Resources/Private/Language/locallang_be.xlf @@ -1,5 +1,5 @@ - +
diff --git a/Resources/Private/Language/locallang_db.xlf b/Resources/Private/Language/locallang_db.xlf index 92ce7638..4d567c57 100644 --- a/Resources/Private/Language/locallang_db.xlf +++ b/Resources/Private/Language/locallang_db.xlf @@ -1,5 +1,5 @@ - +
@@ -29,21 +29,9 @@ Sender email address for email to the Buyer - - Title - - - SKU - URL segment - - Price (net) - - - Price - Special Prices diff --git a/Tests/Fixtures/config/sites/default/config.yaml b/Tests/Fixtures/config/sites/default/config.yaml index 90ed27ed..5213e9a5 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 Products Test - default' \ No newline at end of file +websiteTitle: 'Cart Products Test - default' diff --git a/composer.json b/composer.json index 26306db6..e51e15e1 100644 --- a/composer.json +++ b/composer.json @@ -82,7 +82,16 @@ "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", + "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/crowdin.yml b/crowdin.yml index 068794cc..a027a5fd 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -2,4 +2,4 @@ files: - source: /Resources/Private/Language/ translation: /%original_path%/%two_letters_code%.%original_file_name% ignore: - - /Resources/Private/Language/de.* \ No newline at end of file + - /Resources/Private/Language/de.* diff --git a/shell.nix b/shell.nix index f7657484..61e1c8b9 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 @@ -67,6 +67,60 @@ 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"; + + runtimeInputs = [ + pkgs.libxml2 + ]; + + text = '' + "$PROJECT_ROOT/Build/Scripts/lint-xml.sh" + ''; + }; + + projectLintYaml = pkgs.writeShellApplication { + name = "project-lint-yaml"; + + runtimeInputs = [ + pkgs.yamllint + ]; + + text = '' + "$PROJECT_ROOT/Build/Scripts/lint-yaml.sh" + ''; + }; + + 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"; @@ -141,12 +195,18 @@ in pkgs.mkShellNoCC { pkgs.firefox pkgs.geckodriver pkgs.procps + pkgs.libxml2 + pkgs.yamllint php composer projectInstall projectCgl projectCglFix projectLint + projectLintPhp + projectLintTypoScript + projectLintXml + projectLintYaml projectPhpstan projectTestUnit projectTestFunctional