-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'magento-commerce:develop' into jorsini/MTS-2096
- Loading branch information
Showing
7 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ class AvoidIdSniff implements Sniff | |
T_PLUS, | ||
T_NS_SEPARATOR, | ||
T_LNUMBER, | ||
T_BITWISE_NOT | ||
]; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento2\Tests\Less; | ||
|
||
use PHP_CodeSniffer\Config; | ||
use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest; | ||
|
||
/** | ||
* Implements an abstract base for unit tests that cover less sniffs. | ||
*/ | ||
abstract class AbstractLessSniffUnitTestCase extends AbstractSniffUnitTest | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$config = new Config(); | ||
$config->extensions = array_merge( | ||
$config->extensions, | ||
[ | ||
'less' => 'CSS' | ||
] | ||
); | ||
|
||
$GLOBALS['PHP_CODESNIFFER_CONFIG'] = $config; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// /** | ||
// * Copyright © Magento, Inc. All rights reserved. | ||
// * See COPYING.txt for license details. | ||
// */ | ||
|
||
#foo[bar], | ||
#foo[bar=bash], | ||
#foo[bar~=bash], | ||
#foo[bar$=bash], | ||
#foo[bar*=bash], | ||
#foo[bar|=bash], | ||
#foo[bar='bash'], | ||
#foo:hover, | ||
#foo:nth-last-of-type(n), | ||
#foo::before, | ||
#foo + div, | ||
#foo > div, | ||
#foo ~ div, | ||
#foo\3Abar ~ div, | ||
#foo\:bar ~ div, | ||
#foo.bar .baz, | ||
div#foo { | ||
blah: 'abc'; | ||
} | ||
|
||
.my #foo, | ||
#foo .blah, | ||
.my #foo .blah { | ||
some: 'stuff'; | ||
} | ||
.blah { | ||
#bar .baz(); | ||
.foo #bar .baz(); | ||
#bar .baz(); | ||
|
||
#bar .baz; | ||
.foo #bar .baz; | ||
#bar .baz; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento2\Tests\Less; | ||
|
||
class AvoidIdUnitTest extends AbstractLessSniffUnitTestCase | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getErrorList() | ||
{ | ||
return [ | ||
6 => 1, | ||
7 => 1, | ||
8 => 1, | ||
9 => 1, | ||
10 => 1, | ||
11 => 1, | ||
12 => 1, | ||
13 => 1, | ||
14 => 1, | ||
15 => 1, | ||
16 => 1, | ||
17 => 1, | ||
18 => 1, | ||
19 => 1, | ||
20 => 1, | ||
21 => 1, | ||
22 => 1, | ||
26 => 1, | ||
27 => 1, | ||
28 => 1 | ||
]; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function getWarningList() | ||
{ | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.