diff --git a/.github/workflows-config/typos.toml b/.github/workflows-config/typos.toml index 1ee4ea563d..d305277cb3 100644 --- a/.github/workflows-config/typos.toml +++ b/.github/workflows-config/typos.toml @@ -1,34 +1,45 @@ -[default] -check-comments = true -check-docs = true -check-filenames = true -binary = false -ignore-non-words = false - -type = ["de", "en"] -locale = "en" +[files] +extend-exclude = [ + ".git/", + ".psalm/stubs.php", + ".psalm/wcs.php", + "modules/ppcp-order-tracking/carriers.php", + # German + "modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php", + # Files outside the repository + "node_modules/", + "vendor/", + "*.min.js", + "*.min.css", +] +ignore-hidden = false -# Ignore API keys and two character IDs like 'FO' or "FO" +[default] extend-ignore-re = [ - "\\b[0-9A-Za-z+/_-]{50,}(=|==)?\\b", - "'[A-Za-z0-9]{2}'", - "\"[A-Za-z0-9]{2}\"", + "\\bBig Sur\\b", + "[0-9A-Za-z/+]{64}", + "'PN',", + "'AU' => '[^']+'", + "define\\( 'CONNECT_WOO_SANDBOX_CLIENT_ID', '[^']+'", + # German + "Unter den .*", + "Die Kombination .*", + "Die gewählte .*", + # Lorem ipsum + "Lorem ipsum .*", + "Id cursus metus .*", + "Urna et pharetra .*", + "Mattis nunc sed .*", + "Vestibulum lectus .*", ] -# Known good words -[default.extend-words] -paypal = "paypal" -PayPal = "PayPal" -woocommerce = "woocommerce" +[default.extend-identifiers] Automattic = "Automattic" automattic = "automattic" -Sie = "Sie" -sie = "sie" -oder = "oder" -als = "als" - -# Define known typos to catch -[default.extend-corrections] +# Typos +Github = "GitHub" +Wordpress = "WordPress" +Woocommerce = "WooCommerce" Fatslane = "Fastlane" Fastalne = "Fastlane" Faslane = "Fastlane" @@ -38,39 +49,3 @@ Fastlan = "Fastlane" Fastlanne = "Fastlane" Fatstlane = "Fastlane" Fstlane = "Fastlane" - -# Explicit identifier corrections -[default.extend-identifiers] -"Fatslane" = "Fastlane" -"Fastalne" = "Fastlane" -"Faslane" = "Fastlane" -"Fastlain" = "Fastlane" -"Fasltane" = "Fastlane" -"Fastlan" = "Fastlane" -"Fastlanne" = "Fastlane" -"Fatstlane" = "Fastlane" -"Fstlane" = "Fastlane" - -# Type-specific configurations -[type.php] -check-comments = true -check-docs = true - -[type.js] -extend-glob = [] -binary = false -check-filename = true -check-file = true -unicode = true -ignore-hex = true -identifier-leading-digits = false - -[files] -extend-exclude = [ - "vendor/*", - "node_modules/*", - "*.min.js", - "*.min.css", - "modules/ppcp-order-tracking/*", - "/tests/*" -] diff --git a/changelog.txt b/changelog.txt index f89b8dbf0a..855b8e22c0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -579,7 +579,7 @@ * Fix - Error while syncing tracking data to PayPal -> Sync GZD Tracking #1020 * Fix - Fix product price retrieval for variable product buttons #1000 * Fix - All tabs hidden on OXXO tab visit #1048 -* Fix - Woocommerce Germanized Invoice bug #1017 +* Fix - WooCommerce Germanized Invoice bug #1017 * Fix - Fix shipping address validation #1047 * Fix - Trigger WC JS validation on button click to highlight empty fields #1004 * Fix - Fix PHP 8.1 deprecated error #1009 diff --git a/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js b/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js index 4c2fa9b2d0..a03e7d013b 100644 --- a/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js +++ b/modules/ppcp-button/resources/js/modules/ActionHandler/CheckoutActionHandler.js @@ -104,7 +104,7 @@ class CheckoutActionHandler { .then( function ( data ) { if ( ! data.success ) { spinner.unblock(); - //handle both messages sent from Woocommerce (data.messages) and this plugin (data.data.message) + //handle both messages sent from WooCommerce (data.messages) and this plugin (data.data.message) if ( typeof data.messages !== 'undefined' ) { const domParser = new DOMParser(); errorHandler.appendPreparedErrorMessageElement( diff --git a/modules/ppcp-wc-gateway/src/Admin/RenderAuthorizeAction.php b/modules/ppcp-wc-gateway/src/Admin/RenderAuthorizeAction.php index 4185f61258..74b678a642 100644 --- a/modules/ppcp-wc-gateway/src/Admin/RenderAuthorizeAction.php +++ b/modules/ppcp-wc-gateway/src/Admin/RenderAuthorizeAction.php @@ -53,7 +53,7 @@ public function render( array $order_actions, \WC_Order $wc_order ) : array { /** * Whether the action should be rendered for a certain WooCommerce order. * - * @param \WC_Order $order The Woocommerce order. + * @param \WC_Order $order The WooCommerce order. * * @return bool */ diff --git a/modules/ppcp-wc-gateway/src/Admin/RenderReauthorizeAction.php b/modules/ppcp-wc-gateway/src/Admin/RenderReauthorizeAction.php index 71dbed0ff4..6965ea4d3a 100644 --- a/modules/ppcp-wc-gateway/src/Admin/RenderReauthorizeAction.php +++ b/modules/ppcp-wc-gateway/src/Admin/RenderReauthorizeAction.php @@ -53,7 +53,7 @@ public function render( array $order_actions, \WC_Order $wc_order ) : array { /** * Whether the action should be rendered for a certain WooCommerce order. * - * @param \WC_Order $order The Woocommerce order. + * @param \WC_Order $order The WooCommerce order. * * @return bool */ diff --git a/modules/ppcp-wc-subscriptions/src/Helper/SubscriptionHelper.php b/modules/ppcp-wc-subscriptions/src/Helper/SubscriptionHelper.php index 7ec997d557..758144eb5e 100644 --- a/modules/ppcp-wc-subscriptions/src/Helper/SubscriptionHelper.php +++ b/modules/ppcp-wc-subscriptions/src/Helper/SubscriptionHelper.php @@ -295,7 +295,7 @@ public function previous_transaction( WC_Subscription $subscription, string $vau return ''; } - // Sort orders by oder ID descending. + // Sort orders by order ID descending. rsort( $orders ); $current_order = wc_get_order( array_shift( $orders ) ); if ( ! $current_order instanceof WC_Order ) { diff --git a/readme.txt b/readme.txt index d93d9eebba..3c25f8e0f3 100644 --- a/readme.txt +++ b/readme.txt @@ -735,7 +735,7 @@ If you encounter issues with the PayPal buttons not appearing after an update, p * Fix - Error while syncing tracking data to PayPal -> Sync GZD Tracking #1020 * Fix - Fix product price retrieval for variable product buttons #1000 * Fix - All tabs hidden on OXXO tab visit #1048 -* Fix - Woocommerce Germanized Invoice bug #1017 +* Fix - WooCommerce Germanized Invoice bug #1017 * Fix - Fix shipping address validation #1047 * Fix - Trigger WC JS validation on button click to highlight empty fields #1004 * Fix - Fix PHP 8.1 deprecated error #1009 diff --git a/tests/PHPUnit/Api/CreateOrderForWcOrderTest.php b/tests/PHPUnit/Api/CreateOrderForWcOrderTest.php index b2d16caf77..065fe20977 100644 --- a/tests/PHPUnit/Api/CreateOrderForWcOrderTest.php +++ b/tests/PHPUnit/Api/CreateOrderForWcOrderTest.php @@ -11,16 +11,16 @@ class CreateOrderForWcOrderTest extends ModularTestCase { - private $orderProcesor; + private $orderProcessor; public function setUp(): void { parent::setUp(); - $this->orderProcesor = Mockery::mock(OrderProcessor::class); + $this->orderProcessor = Mockery::mock(OrderProcessor::class); $this->bootstrapModule([ 'wcgateway.order-processor' => function () { - return $this->orderProcesor; + return $this->orderProcessor; }, ]); } @@ -28,7 +28,7 @@ public function setUp(): void { public function testSuccess(): void { $wcOrder = Mockery::mock(WC_Order::class); $ret = Mockery::mock(Order::class); - $this->orderProcesor + $this->orderProcessor ->expects('create_order') ->with($wcOrder) ->andReturn($ret) @@ -39,7 +39,7 @@ public function testSuccess(): void { public function testFailure(): void { $wcOrder = Mockery::mock(WC_Order::class); - $this->orderProcesor + $this->orderProcessor ->expects('create_order') ->with($wcOrder) ->andThrow(new RuntimeException()) diff --git a/tests/PHPUnit/ApiClient/Entity/AuthorizationStatusTest.php b/tests/PHPUnit/ApiClient/Entity/AuthorizationStatusTest.php index 1d98cd7c7d..c664f2eb5e 100644 --- a/tests/PHPUnit/ApiClient/Entity/AuthorizationStatusTest.php +++ b/tests/PHPUnit/ApiClient/Entity/AuthorizationStatusTest.php @@ -27,7 +27,7 @@ public function testInvalidStatusProvided() new AuthorizationStatus('invalid'); } - public function testStatusComparision() + public function testStatusComparison() { $authorizationStatus = new AuthorizationStatus('CREATED'); diff --git a/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php b/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php index 73d948c460..bbcb0a721c 100644 --- a/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php +++ b/tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php @@ -280,7 +280,7 @@ public function testWcCartDefault() $this->assertEquals($shipping, $unit->shipping()); } - public function testWcCartShippingGetsDroppendWhenNoCustomer() + public function testWcCartShippingGetsDroppedWhenNoCustomer() { expect('WC') ->andReturn((object) ['customer' => null, 'session' => null]); @@ -311,7 +311,7 @@ public function testWcCartShippingGetsDroppendWhenNoCustomer() $this->assertNull($unit->shipping()); } - public function testWcCartShippingGetsDroppendWhenNoCountryCode() + public function testWcCartShippingGetsDroppedWhenNoCountryCode() { expect('WC') ->andReturn((object) ['customer' => Mockery::mock(\WC_Customer::class), 'session' => null]);