Skip to content

AC-1100 Catch badly put newlines in LESS files #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from 1 commit
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
Prev Previous commit
AC-1100: Catch badly put newlines in LESS files
  • Loading branch information
svera committed Sep 3, 2021
commit e2aa287eb60ed7afed1cdce1f9d5225e2b3f309d
7 changes: 5 additions & 2 deletions Magento2/Sniffs/Less/ColonSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function register()
public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();

if ($this->needValidateSpaces($phpcsFile, $stackPtr, $tokens)) {
$this->validateSpaces($phpcsFile, $stackPtr, $tokens);
}
Expand Down Expand Up @@ -75,7 +75,10 @@ private function needValidateSpaces(File $phpcsFile, $stackPtr, $tokens)
}

/**
* Validate Colon Spacing according to requirements
* Validate Colon Spacing according to requirements:
* - No spaces before colon
* - Exactly 1 space after colon
* - No property definition scattered among several lines
*
* @param File $phpcsFile
* @param int $stackPtr
Expand Down