From 37e425c1fb2c8859e20af0dd4c94b93ed97d059b Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Tue, 31 Aug 2021 12:27:36 +0200 Subject: [PATCH 1/3] AC-947: Create unit test for Magento2\Less\IndentationSniff check --- Magento2/Tests/Less/IndentationUnitTest.less | 21 +++++++++++++ Magento2/Tests/Less/IndentationUnitTest.php | 33 ++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 Magento2/Tests/Less/IndentationUnitTest.less create mode 100644 Magento2/Tests/Less/IndentationUnitTest.php diff --git a/Magento2/Tests/Less/IndentationUnitTest.less b/Magento2/Tests/Less/IndentationUnitTest.less new file mode 100644 index 00000000..a44e5a4a --- /dev/null +++ b/Magento2/Tests/Less/IndentationUnitTest.less @@ -0,0 +1,21 @@ +// /** +// * Copyright © Magento, Inc. All rights reserved. +// * See COPYING.txt for license details. +// */ + +.nav { + background: green; + .nav-item { + background: green; + } +} + +.bar { + background: red; + .bar-item { + background: red; + .bar-item-child { + background: red; + } + } +} \ No newline at end of file diff --git a/Magento2/Tests/Less/IndentationUnitTest.php b/Magento2/Tests/Less/IndentationUnitTest.php new file mode 100644 index 00000000..dd37532c --- /dev/null +++ b/Magento2/Tests/Less/IndentationUnitTest.php @@ -0,0 +1,33 @@ + 1, + 15 => 1, + 16 => 1, + 17 => 1, + 18 => 1, + 19 => 1, + 20 => 1 + ]; + } + + /** + * @inheritdoc + */ + public function getWarningList() + { + return []; + } +} \ No newline at end of file From 914214b80bcaf9149794f16159c21211c1810ce9 Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Tue, 31 Aug 2021 12:29:03 +0200 Subject: [PATCH 2/3] AC-947: Create unit test for Magento2\Less\IndentationSniff check - Refactor: Use different space amount for incorrect less lines --- Magento2/Tests/Less/IndentationUnitTest.less | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Magento2/Tests/Less/IndentationUnitTest.less b/Magento2/Tests/Less/IndentationUnitTest.less index a44e5a4a..768fdeaa 100644 --- a/Magento2/Tests/Less/IndentationUnitTest.less +++ b/Magento2/Tests/Less/IndentationUnitTest.less @@ -13,9 +13,9 @@ .bar { background: red; .bar-item { - background: red; - .bar-item-child { + background: red; + .bar-item-child { background: red; - } + } } -} \ No newline at end of file +} From 9e9733564d435de326e59e10c7aaf61f0e8fc616 Mon Sep 17 00:00:00 2001 From: Marc Ginesta Date: Tue, 31 Aug 2021 12:34:03 +0200 Subject: [PATCH 3/3] AC-947: Create unit test for Magento2\Less\IndentationSniff check - Refactor: small amends --- Magento2/Tests/Less/IndentationUnitTest.less | 4 ++-- Magento2/Tests/Less/IndentationUnitTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Magento2/Tests/Less/IndentationUnitTest.less b/Magento2/Tests/Less/IndentationUnitTest.less index 768fdeaa..1ddbff6f 100644 --- a/Magento2/Tests/Less/IndentationUnitTest.less +++ b/Magento2/Tests/Less/IndentationUnitTest.less @@ -14,8 +14,8 @@ background: red; .bar-item { background: red; - .bar-item-child { - background: red; + .bar-item-child { + background: red; } } } diff --git a/Magento2/Tests/Less/IndentationUnitTest.php b/Magento2/Tests/Less/IndentationUnitTest.php index dd37532c..a7bf6502 100644 --- a/Magento2/Tests/Less/IndentationUnitTest.php +++ b/Magento2/Tests/Less/IndentationUnitTest.php @@ -30,4 +30,4 @@ public function getWarningList() { return []; } -} \ No newline at end of file +}