Skip to content

Commit 53af74c

Browse files
dependabot[bot]neilime
authored andcommitted
build(deps): bump hoverkraft-tech/ci-github-common
Bumps the github-actions-dependencies group with 1 update: [hoverkraft-tech/ci-github-common](https://github.com/hoverkraft-tech/ci-github-common). Updates `hoverkraft-tech/ci-github-common` from 0.23.1 to 0.24.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@6857ef6...b488399) --- updated-dependencies: - dependency-name: hoverkraft-tech/ci-github-common dependency-version: 0.24.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Emilien Escalle <[email protected]>
1 parent e9bc5f1 commit 53af74c

File tree

9 files changed

+99
-100
lines changed

9 files changed

+99
-100
lines changed

.github/workflows/need-fix-to-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919

2020
jobs:
2121
main:
22-
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@6857ef6d10f704e0998aa4955282f27d1b9be778 # 0.23.1
22+
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0
2323
with:
2424
manual-commit-ref: ${{ inputs.manual-commit-ref }}
2525
manual-base-ref: ${{ inputs.manual-base-ref }}

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ on:
66

77
jobs:
88
main:
9-
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@6857ef6d10f704e0998aa4955282f27d1b9be778 # 0.23.1
9+
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@b4883995e100e291a1fed68678d47a560328ed08 # 0.24.0

composer.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
"name": "Neilime",
1818
"homepage": "https://github.com/neilime",
1919
"role": "Developer"
20+
},
21+
{
22+
"name": "ESCEMI",
23+
"homepage": "https://github.com/escemi-tech",
24+
"role": "Developer"
2025
}
2126
],
2227
"support": {
@@ -77,14 +82,6 @@
7782
},
7883
"config": {
7984
"optimize-autoloader": true,
80-
"sort-packages": true,
81-
"allow-plugins": {
82-
"phpstan/extension-installer": true
83-
}
84-
},
85-
"extra": {
86-
"branch-alias": {
87-
"dev-master": "1.0-dev"
88-
}
85+
"sort-packages": true
8986
}
9087
}

src/CssLint/Cli.php

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -70,58 +70,58 @@ private function printUsage(): void
7070
$defaultFormatter = $availableFormatters[0];
7171

7272
$this->printLine(
73-
'Usage:' . PHP_EOL .
74-
'------' . PHP_EOL .
75-
PHP_EOL .
76-
' ' . self::SCRIPT_NAME . " [--options='{ }'] [--formatter=name] [--formatter=name:path] input_to_lint" . PHP_EOL .
77-
PHP_EOL .
78-
'Arguments:' . PHP_EOL .
79-
'----------' . PHP_EOL .
80-
PHP_EOL .
81-
' --options' . PHP_EOL .
82-
' Options (optional), must be a json object:' . PHP_EOL .
83-
' * "allowedIndentationChars" => [" "] or ["\t"]: will override the current property' . PHP_EOL .
84-
' * "constructors": { "property" => bool }: will merge with the current property' . PHP_EOL .
85-
' * "standards": { "property" => bool }: will merge with the current property' . PHP_EOL .
86-
' * "nonStandards": { "property" => bool }: will merge with the current property' . PHP_EOL .
87-
' Example: --options=\'{ "constructors": {"o" : false}, "allowedIndentationChars": ["\t"] }\'' .
88-
PHP_EOL .
89-
PHP_EOL .
90-
' --formatter' . PHP_EOL .
91-
' The formatter(s) to be used. Can be specified multiple times.' . PHP_EOL .
92-
' Format: --formatter=name (output to stdout) or --formatter=name:path (output to file)' . PHP_EOL .
93-
' If not specified, the default formatter will output to stdout.' . PHP_EOL .
94-
' Available formatters: ' . implode(', ', $availableFormatters) . PHP_EOL .
95-
' Examples:' . PHP_EOL .
96-
' output to stdout: --formatter=' . $defaultFormatter . PHP_EOL .
97-
' output to file: --formatter=' . $defaultFormatter . ':report.txt' . PHP_EOL .
98-
' multiple outputs: --formatter=' . $defaultFormatter . ' --formatter=' . $availableFormatters[1] . ':report.json' . PHP_EOL .
99-
PHP_EOL .
100-
' input_to_lint' . PHP_EOL .
101-
' The CSS file path (absolute or relative)' . PHP_EOL .
102-
' a glob pattern of file(s) to be linted' . PHP_EOL .
103-
' or a CSS string to be linted' . PHP_EOL .
104-
' Example:' . PHP_EOL .
105-
' "./path/to/css_file_path_to_lint.css"' . PHP_EOL .
106-
' "./path/to/css_file_path_to_lint/*.css"' . PHP_EOL .
107-
' ".test { color: red; }"' . PHP_EOL .
108-
PHP_EOL .
109-
'Examples:' . PHP_EOL .
110-
'---------' . PHP_EOL .
111-
PHP_EOL .
112-
' Lint a CSS file:' . PHP_EOL .
113-
' ' . self::SCRIPT_NAME . ' "./path/to/css_file_path_to_lint.css"' . PHP_EOL . PHP_EOL .
114-
' Lint a CSS string:' . PHP_EOL .
115-
' ' . self::SCRIPT_NAME . ' ".test { color: red; }"' . PHP_EOL . PHP_EOL .
116-
' Lint with only tabulation as indentation:' . PHP_EOL .
117-
' ' . self::SCRIPT_NAME .
118-
' --options=\'{ "allowedIndentationChars": ["\t"] }\' ".test { color: red; }"' . PHP_EOL . PHP_EOL .
119-
' Output to a file:' . PHP_EOL .
120-
' ' . self::SCRIPT_NAME . ' --formatter=plain:output.txt ".test { color: red; }"' . PHP_EOL . PHP_EOL .
121-
' Generate GitLab CI report:' . PHP_EOL .
122-
' ' . self::SCRIPT_NAME . ' --formatter=gitlab-ci:report.json "./path/to/css_file.css"' . PHP_EOL . PHP_EOL .
123-
' Multiple outputs (console and file):' . PHP_EOL .
124-
' ' . self::SCRIPT_NAME . ' --formatter=plain --formatter=gitlab-ci:ci-report.json ".test { color: red; }"' . PHP_EOL . PHP_EOL
73+
'Usage:' . PHP_EOL
74+
. '------' . PHP_EOL
75+
. PHP_EOL
76+
. ' ' . self::SCRIPT_NAME . " [--options='{ }'] [--formatter=name] [--formatter=name:path] input_to_lint" . PHP_EOL
77+
. PHP_EOL
78+
. 'Arguments:' . PHP_EOL
79+
. '----------' . PHP_EOL
80+
. PHP_EOL
81+
. ' --options' . PHP_EOL
82+
. ' Options (optional), must be a json object:' . PHP_EOL
83+
. ' * "allowedIndentationChars" => [" "] or ["\t"]: will override the current property' . PHP_EOL
84+
. ' * "constructors": { "property" => bool }: will merge with the current property' . PHP_EOL
85+
. ' * "standards": { "property" => bool }: will merge with the current property' . PHP_EOL
86+
. ' * "nonStandards": { "property" => bool }: will merge with the current property' . PHP_EOL
87+
. ' Example: --options=\'{ "constructors": {"o" : false}, "allowedIndentationChars": ["\t"] }\''
88+
. PHP_EOL
89+
. PHP_EOL
90+
. ' --formatter' . PHP_EOL
91+
. ' The formatter(s) to be used. Can be specified multiple times.' . PHP_EOL
92+
. ' Format: --formatter=name (output to stdout) or --formatter=name:path (output to file)' . PHP_EOL
93+
. ' If not specified, the default formatter will output to stdout.' . PHP_EOL
94+
. ' Available formatters: ' . implode(', ', $availableFormatters) . PHP_EOL
95+
. ' Examples:' . PHP_EOL
96+
. ' output to stdout: --formatter=' . $defaultFormatter . PHP_EOL
97+
. ' output to file: --formatter=' . $defaultFormatter . ':report.txt' . PHP_EOL
98+
. ' multiple outputs: --formatter=' . $defaultFormatter . ' --formatter=' . $availableFormatters[1] . ':report.json' . PHP_EOL
99+
. PHP_EOL
100+
. ' input_to_lint' . PHP_EOL
101+
. ' The CSS file path (absolute or relative)' . PHP_EOL
102+
. ' a glob pattern of file(s) to be linted' . PHP_EOL
103+
. ' or a CSS string to be linted' . PHP_EOL
104+
. ' Example:' . PHP_EOL
105+
. ' "./path/to/css_file_path_to_lint.css"' . PHP_EOL
106+
. ' "./path/to/css_file_path_to_lint/*.css"' . PHP_EOL
107+
. ' ".test { color: red; }"' . PHP_EOL
108+
. PHP_EOL
109+
. 'Examples:' . PHP_EOL
110+
. '---------' . PHP_EOL
111+
. PHP_EOL
112+
. ' Lint a CSS file:' . PHP_EOL
113+
. ' ' . self::SCRIPT_NAME . ' "./path/to/css_file_path_to_lint.css"' . PHP_EOL . PHP_EOL
114+
. ' Lint a CSS string:' . PHP_EOL
115+
. ' ' . self::SCRIPT_NAME . ' ".test { color: red; }"' . PHP_EOL . PHP_EOL
116+
. ' Lint with only tabulation as indentation:' . PHP_EOL
117+
. ' ' . self::SCRIPT_NAME
118+
. ' --options=\'{ "allowedIndentationChars": ["\t"] }\' ".test { color: red; }"' . PHP_EOL . PHP_EOL
119+
. ' Output to a file:' . PHP_EOL
120+
. ' ' . self::SCRIPT_NAME . ' --formatter=plain:output.txt ".test { color: red; }"' . PHP_EOL . PHP_EOL
121+
. ' Generate GitLab CI report:' . PHP_EOL
122+
. ' ' . self::SCRIPT_NAME . ' --formatter=gitlab-ci:report.json "./path/to/css_file.css"' . PHP_EOL . PHP_EOL
123+
. ' Multiple outputs (console and file):' . PHP_EOL
124+
. ' ' . self::SCRIPT_NAME . ' --formatter=plain --formatter=gitlab-ci:ci-report.json ".test { color: red; }"' . PHP_EOL . PHP_EOL
125125
);
126126
}
127127

src/CssLint/Tokenizer/Parser/BlockParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static function getBlockContent(TokenizerContext $tokenizerContext): stri
6666
/**
6767
* Performs parsing tokenizer current context, check block part
6868
*/
69-
public function parseCurrentContext(TokenizerContext $tokenizerContext): BlockToken|null
69+
public function parseCurrentContext(TokenizerContext $tokenizerContext): ?BlockToken
7070
{
7171
if ($this->lastCharIsSpace($tokenizerContext)) {
7272
return null;
@@ -76,7 +76,7 @@ public function parseCurrentContext(TokenizerContext $tokenizerContext): BlockTo
7676
return $this->handleBlockToken($tokenizerContext, $currentBlockToken);
7777
}
7878

79-
private function handleBlockToken(TokenizerContext $tokenizerContext, ?BlockToken $currentBlockToken): BlockToken|null
79+
private function handleBlockToken(TokenizerContext $tokenizerContext, ?BlockToken $currentBlockToken): ?BlockToken
8080
{
8181
if (static::isBlockStart($tokenizerContext)) {
8282
$blockToken = $this->createBlockToken($tokenizerContext);

tests/TestSuite/CliTest.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public function testRunWithoutArgumentMustReturnsErrorCode()
4848
public function testRunWithValidStringShouldReturnSuccessCode()
4949
{
5050
$this->expectOutputString(
51-
'# Lint CSS string...' . PHP_EOL .
52-
"\033[32m => Success: CSS string is valid.\033[0m" . PHP_EOL .
53-
PHP_EOL
51+
'# Lint CSS string...' . PHP_EOL
52+
. "\033[32m => Success: CSS string is valid.\033[0m" . PHP_EOL
53+
. PHP_EOL
5454
);
5555
$this->assertEquals(
5656
0,
@@ -62,10 +62,10 @@ public function testRunWithValidStringShouldReturnSuccessCode()
6262
public function testRunWithNotValidStringShouldReturnErrorCode()
6363
{
6464
$this->expectOutputString(
65-
'# Lint CSS string...' . PHP_EOL .
66-
"\033[31m - [unexpected_character_in_block_content]: block - Unexpected character: \":\" (line 1, column 6 to line 3, column 16)\033[0m" . PHP_EOL .
67-
"\033[31m - [invalid_property_declaration]: property - Unknown property \"displady\" (line 1, column 7 to line 1, column 23)\033[0m" . PHP_EOL .
68-
"\033[31m => Failure: CSS string is invalid CSS.\033[0m" . PHP_EOL
65+
'# Lint CSS string...' . PHP_EOL
66+
. "\033[31m - [unexpected_character_in_block_content]: block - Unexpected character: \":\" (line 1, column 6 to line 3, column 16)\033[0m" . PHP_EOL
67+
. "\033[31m - [invalid_property_declaration]: property - Unknown property \"displady\" (line 1, column 7 to line 1, column 23)\033[0m" . PHP_EOL
68+
. "\033[31m => Failure: CSS string is invalid CSS.\033[0m" . PHP_EOL
6969
);
7070

7171
$this->assertEquals(1, $this->cli->run([
@@ -81,10 +81,10 @@ public function testRunWithNotValidFileShouldReturnErrorCode()
8181
$fileToLint = $this->testFixturesDir . '/not_valid.css';
8282

8383
$this->expectOutputString(
84-
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL .
85-
"\033[31m - [invalid_property_declaration]: property - Unknown property \"bordr-top-style\" (line 3, column 5 to line 3, column 27)\033[0m" . PHP_EOL .
86-
"\033[31m - [unclosed_token]: block - Unclosed \"block\" detected (line 1, column 23 to line 6, column 2)\033[0m" . PHP_EOL .
87-
"\033[31m => Failure: CSS file \"$fileToLint\" is invalid CSS.\033[0m" . PHP_EOL
84+
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL
85+
. "\033[31m - [invalid_property_declaration]: property - Unknown property \"bordr-top-style\" (line 3, column 5 to line 3, column 27)\033[0m" . PHP_EOL
86+
. "\033[31m - [unclosed_token]: block - Unclosed \"block\" detected (line 1, column 23 to line 6, column 2)\033[0m" . PHP_EOL
87+
. "\033[31m => Failure: CSS file \"$fileToLint\" is invalid CSS.\033[0m" . PHP_EOL
8888
);
8989
$this->assertEquals(1, $this->cli->run(['php-css-lint', $fileToLint]));
9090
}
@@ -93,9 +93,9 @@ public function testRunWithGlobShouldReturnSuccessCode()
9393
{
9494
$fileToLint = $this->testFixturesDir . '/valid.css';
9595
$this->expectOutputString(
96-
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL .
97-
"\033[32m => Success: CSS file \"$fileToLint\" is valid.\033[0m" . PHP_EOL .
98-
PHP_EOL
96+
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL
97+
. "\033[32m => Success: CSS file \"$fileToLint\" is valid.\033[0m" . PHP_EOL
98+
. PHP_EOL
9999
);
100100
$this->assertEquals(0, $this->cli->run(['php-css-lint', $this->testFixturesDir . '/valid*.css']), $this->getActualOutput());
101101
}
@@ -114,20 +114,20 @@ public function testRunWithNotValidFileGlobShouldReturnErrorCode()
114114
{
115115
$fileToLint = $this->testFixturesDir . '/not_valid.css';
116116
$this->expectOutputString(
117-
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL .
118-
"\033[31m - [invalid_property_declaration]: property - Unknown property \"bordr-top-style\" (line 3, column 5 to line 3, column 27)\033[0m" . PHP_EOL .
119-
"\033[31m - [unclosed_token]: block - Unclosed \"block\" detected (line 1, column 23 to line 6, column 2)\033[0m" . PHP_EOL .
120-
"\033[31m => Failure: CSS file \"$fileToLint\" is invalid CSS.\033[0m" . PHP_EOL
117+
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL
118+
. "\033[31m - [invalid_property_declaration]: property - Unknown property \"bordr-top-style\" (line 3, column 5 to line 3, column 27)\033[0m" . PHP_EOL
119+
. "\033[31m - [unclosed_token]: block - Unclosed \"block\" detected (line 1, column 23 to line 6, column 2)\033[0m" . PHP_EOL
120+
. "\033[31m => Failure: CSS file \"$fileToLint\" is invalid CSS.\033[0m" . PHP_EOL
121121
);
122122
$this->assertEquals(1, $this->cli->run(['php-css-lint', $this->testFixturesDir . '/not_valid*.css']));
123123
}
124124

125125
public function testRunWithOptionsMustBeUsedByTheLinter()
126126
{
127127
$this->expectOutputString(
128-
"# Lint CSS string..." . PHP_EOL .
129-
"\033[31m - [invalid_indentation_character]: whitespace - Unexpected char \" \" (line 2, column 1 to line 2, column 2)\033[0m" . PHP_EOL .
130-
"\033[31m => Failure: CSS string is invalid CSS.\033[0m" . PHP_EOL
128+
"# Lint CSS string..." . PHP_EOL
129+
. "\033[31m - [invalid_indentation_character]: whitespace - Unexpected char \" \" (line 2, column 1 to line 2, column 2)\033[0m" . PHP_EOL
130+
. "\033[31m => Failure: CSS string is invalid CSS.\033[0m" . PHP_EOL
131131
);
132132

133133
$this->assertEquals(1, $this->cli->run([
@@ -168,9 +168,9 @@ public function testRunWithFormatterArgumentShouldReturnSuccessCode()
168168
{
169169
$fileToLint = $this->testFixturesDir . '/valid.css';
170170
$this->expectOutputString(
171-
"::group::Lint CSS file \"$fileToLint\"" . PHP_EOL .
172-
"::notice ::Success: CSS file \"$fileToLint\" is valid." . PHP_EOL .
173-
"::endgroup::" . PHP_EOL
171+
"::group::Lint CSS file \"$fileToLint\"" . PHP_EOL
172+
. "::notice ::Success: CSS file \"$fileToLint\" is valid." . PHP_EOL
173+
. "::endgroup::" . PHP_EOL
174174
);
175175
$this->assertEquals(0, $this->cli->run(['php-css-lint', '--formatter=github-actions', $fileToLint]), $this->getActualOutput());
176176
}
@@ -203,9 +203,9 @@ public function testRunWithValidFileShouldReturnSuccessCode(string $fileToLint)
203203
{
204204
$fileToLint = $this->testFixturesDir . '/' . $fileToLint;
205205
$this->expectOutputString(
206-
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL .
207-
"\033[32m => Success: CSS file \"$fileToLint\" is valid.\033[0m" . PHP_EOL .
208-
PHP_EOL
206+
"# Lint CSS file \"$fileToLint\"..." . PHP_EOL
207+
. "\033[32m => Success: CSS file \"$fileToLint\" is valid.\033[0m" . PHP_EOL
208+
. PHP_EOL
209209
);
210210
$this->assertEquals(0, $this->cli->run(['php-css-lint', $fileToLint]), $this->getActualOutput());
211211
}

tests/TestSuite/LinterTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,12 @@ public function testLintFileWithUnreadableFilePathParam()
196196
public function testLintComment()
197197
{
198198
// Act
199-
$errors =
200-
$this->linter->lintString(
201-
"/*" . PHP_EOL .
202-
" * This is a comment" . PHP_EOL .
203-
"*/" . PHP_EOL .
204-
".test { }"
199+
$errors
200+
= $this->linter->lintString(
201+
"/*" . PHP_EOL
202+
. " * This is a comment" . PHP_EOL
203+
. "*/" . PHP_EOL
204+
. ".test { }"
205205
);
206206

207207
// Assert

tests/TestSuite/Output/Formatter/GithubActionsFormatterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public function testEndLintingOutputsEndGroup(): void
8888

8989
// Assert
9090
$this->assertSame(
91-
"::notice ::Success: file.css is valid." . PHP_EOL .
92-
"::endgroup::" . PHP_EOL,
91+
"::notice ::Success: file.css is valid." . PHP_EOL
92+
. "::endgroup::" . PHP_EOL,
9393
$content
9494
);
9595
}

tools/composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"rector/rector": "^2.1"
99
},
1010
"config": {
11+
"optimize-autoloader": true,
12+
"sort-packages": true,
1113
"allow-plugins": {
1214
"phpstan/extension-installer": true
1315
}

0 commit comments

Comments
 (0)