Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ jobs:
- name: PHP lint
run: Build/Scripts/lint-php.sh

typos-linting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install typos
run: pipx install typos

- name: Typos lint
run: Build/Scripts/lint-typos.sh

typoscript-linting:
runs-on: ubuntu-latest
steps:
Expand Down
24 changes: 24 additions & 0 deletions Build/Scripts/lint-typos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# Checks the spelling of all files of the extension with typos, using
# Build/typos.toml. Files ignored by .gitignore are skipped.
#
# typos is not installed via composer. It is provided by shell.nix, in CI it
# is installed via pipx.
#
# Usage:
# Build/Scripts/lint-typos.sh report typos
# Build/Scripts/lint-typos.sh --fix fix unambiguous typos in place

source "$(dirname "${BASH_SOURCE[0]}")/common.sh"

if ! command -v typos > /dev/null; then
echo "Missing typos, please install it first, e.g. \"pipx install typos\"." >&2
exit 1
fi

if [ "${1:-}" = "--fix" ]; then
typos --config Build/typos.toml --write-changes
else
typos --config Build/typos.toml
fi
16 changes: 16 additions & 0 deletions Build/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[files]
extend-exclude = [
# Vendored schemas, kept as published.
"Build/xliff-core-1.2-strict.xsd",
"Build/xml.xsd",
# Misspelled file name, renaming it would change the documentation URL.
"Documentation/Changelog/2.4/Feature-71-AllowToRenderBackendVariantsInDifferendSelectors.rst",
]

[default.extend-words]
# German test data.
produkt = "produkt"

[default.extend-identifiers]
# TYPO3 core API.
substNEWwithIDs = "substNEWwithIDs"
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getIdentifier(): string

public function getTitle(): string
{
return 'Migrates plugins of existing cart_produts plugins using switchableControllerActions';
return 'Migrates plugins of existing cart_products plugins using switchableControllerActions';
}

public function getDescription(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ the individual parameter are described.
:Type: array
:Default: The TypoScript template use the setting defined by the constant of the cart extension.

Configures how prices should be formated in frontend. The
Configures how prices should be formatted in frontend. The
`\Extcode\Cart\ViewHelpers\Format\CurrencyViewHelper` uses this global
setting.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Description

In some cases you don't need a detail page for the products and want to allow adding products to the shopping cart
in the list view.
Diese Änderung erlaubt es, der showForm Action das Produkt als Parameter mitzugeben.
This change allows to pass the product as parameter to the showForm action.

Integration
===========
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ All installations which are not set up with version 5 of EXT:cart_products
Migration
=========

1. Run the UpdateWizard "Migrates plugins of existing cart_produts plugins
1. Run the UpdateWizard "Migrates plugins of existing cart_products plugins
using switchableControllerActions".
2. Adapt the value of `plugin` from `Products` to `ShowProduct` in your site
configuration (`config/sites/<your-site>/config.yaml`):
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Editor/EditingAProduct/Description/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Description
===========

A longer description of the product. This is limited to text, for further
options the below descriped 'Content' can be used.
options the below described 'Content' can be used.

Content
=======
Expand Down
4 changes: 2 additions & 2 deletions Tests/Unit/Domain/Model/Product/ProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ public function getBestSpecialPriceForGivenSpecialPricesReturnsBestSpecialPrice(
public function getBestSpecialPriceDiscountForGivenSpecialPriceReturnsPercentageDiscount(): void
{
$price = 10.0;
$porductSpecialPrice = 9.0;
$productSpecialPrice = 9.0;

$product = new Product();
$product->setPrice($price);

$specialPrice = new SpecialPrice();
$specialPrice->setPrice($porductSpecialPrice);
$specialPrice->setPrice($productSpecialPrice);

$product->addSpecialPrice($specialPrice);

Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,14 @@
"project:cgl:fix": "Build/Scripts/cgl.sh --fix",
"project:lint": [
"@project:lint:php",
"@project:lint:typos",
"@project:lint:typoscript",
"@project:lint:xml",
"@project:lint:yaml"
],
"project:lint:php": "Build/Scripts/lint-php.sh",
"project:lint:typos": "Build/Scripts/lint-typos.sh",
"project:lint:typos:fix": "Build/Scripts/lint-typos.sh --fix",
"project:lint:typoscript": "Build/Scripts/lint-typoscript.sh",
"project:lint:xml": "Build/Scripts/lint-xml.sh",
"project:lint:yaml": "Build/Scripts/lint-yaml.sh",
Expand Down
29 changes: 29 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,30 @@ let
'';
};

projectLintTypos = pkgs.writeShellApplication {
name = "project-lint-typos";

runtimeInputs = [
pkgs.typos
];

text = ''
"$PROJECT_ROOT/Build/Scripts/lint-typos.sh"
'';
};

projectLintTyposFix = pkgs.writeShellApplication {
name = "project-lint-typos-fix";

runtimeInputs = [
pkgs.typos
];

text = ''
"$PROJECT_ROOT/Build/Scripts/lint-typos.sh" --fix
'';
};

projectLintTypoScript = pkgs.writeShellApplication {
name = "project-lint-typoscript";

Expand Down Expand Up @@ -108,13 +132,15 @@ let

runtimeInputs = [
projectLintPhp
projectLintTypos
projectLintTypoScript
projectLintXml
projectLintYaml
];

text = ''
project-lint-php
project-lint-typos
project-lint-typoscript
project-lint-xml
project-lint-yaml
Expand Down Expand Up @@ -188,6 +214,7 @@ in pkgs.mkShellNoCC {
pkgs.geckodriver
pkgs.procps
pkgs.libxml2
pkgs.typos
pkgs.yamllint
php
composer
Expand All @@ -196,6 +223,8 @@ in pkgs.mkShellNoCC {
projectCglFix
projectLint
projectLintPhp
projectLintTypos
projectLintTyposFix
projectLintTypoScript
projectLintXml
projectLintYaml
Expand Down
Loading