Skip to content

Commit 6f1b011

Browse files
committed
feat!: separate parsing from linting
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent dcc2001 commit 6f1b011

File tree

68 files changed

+5801
-1108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+5801
-1108
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.cursor
12
/nbproject/
23
/vendor
34
/tools/vendor

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ shell: ## Execute shell in given PHP version container
2525
@$(call run-php,bash)
2626

2727
test: ## Execute tests for given PHP version
28-
@$(call run-php,composer test $(filter-out $@,$(MAKECMDGOALS)))
28+
@$(call run-php,composer test -- $(filter-out $@,$(MAKECMDGOALS)))
2929

30-
test-update: ## Execute tests and update snapshots for given PHP version
31-
@$(call run-php,composer test:update-snapshot $(filter-out $@,$(MAKECMDGOALS)))
30+
test-ci: ## Execute tests and CI for given PHP version
31+
@$(call run-php,composer test:ci -- $(filter-out $@,$(MAKECMDGOALS)))
3232

3333
test-load-fixtures: ## Execute tests and load fixtures for given PHP version
34-
@$(call run-php,composer test:load-fixtures $(filter-out $@,$(MAKECMDGOALS)))
34+
@$(call run-php,composer test:load-fixtures -- $(filter-out $@,$(MAKECMDGOALS)))
3535

3636
lint: ## Execute lint for given PHP version
3737
$(MAKE) php-cs-fixer $(filter-out $@,$(MAKECMDGOALS))
@@ -43,25 +43,25 @@ lint-fix: ## Execute lint fixing for given PHP version
4343
$(MAKE) rector-fix $(filter-out $@,$(MAKECMDGOALS))
4444

4545
php-cs-fixer: ## Execute php-cs-fixer for given PHP version
46-
@$(call run-php,composer php-cs-fixer $(filter-out $@,$(MAKECMDGOALS)))
46+
@$(call run-php,composer php-cs-fixer -- $(filter-out $@,$(MAKECMDGOALS)))
4747

4848
php-cs-fixer-fix: ## Execute php-cs-fixer fixing for given PHP version
49-
@$(call run-php,composer php-cs-fixer:fix $(filter-out $@,$(MAKECMDGOALS)))
49+
@$(call run-php,composer php-cs-fixer:fix -- $(filter-out $@,$(MAKECMDGOALS)))
5050

5151
rector: ## Execute rector for given PHP version
52-
@$(call run-php,composer rector $(filter-out $@,$(MAKECMDGOALS)))
52+
@$(call run-php,composer rector -- $(filter-out $@,$(MAKECMDGOALS)))
5353

5454
rector-fix: ## Execute rector fixing for given PHP version
55-
@$(call run-php,composer rector:fix $(filter-out $@,$(MAKECMDGOALS)))
55+
@$(call run-php,composer rector:fix -- $(filter-out $@,$(MAKECMDGOALS)))
5656

5757
phpstan: ## Execute PHPStan for given PHP version
58-
@$(call run-php,composer phpstan $(filter-out $@,$(MAKECMDGOALS)))
58+
@$(call run-php,composer phpstan -- $(filter-out $@,$(MAKECMDGOALS)))
5959

6060
ci: ## Execute CI scripts for given PHP version
61-
@$(call run-php,composer ci $(filter-out $@,$(MAKECMDGOALS)))
61+
@$(call run-php,composer ci -- $(filter-out $@,$(MAKECMDGOALS)))
6262

6363
generate-css-referentials: ## Generate referentials for given PHP version
64-
@$(call run-php,composer generate-css-referentials $(filter-out $@,$(MAKECMDGOALS)))
64+
@$(call run-php,composer generate-css-referentials -- $(filter-out $@,$(MAKECMDGOALS)))
6565

6666
## Run PHP for given version
6767
define run-php

rector.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@
1414
->withAttributesSets(
1515
all: true
1616
)
17-
->withPreparedSets(
18-
deadCode: true,
19-
codeQuality: true,
20-
codingStyle: true,
21-
typeDeclarations: true,
22-
privatization: true,
23-
naming: true,
24-
instanceOf: true,
25-
earlyReturn: true,
26-
strictBooleans: true,
27-
carbon: true,
28-
rectorPreset: true,
29-
phpunitCodeQuality: true,
17+
->withComposerBased(
3018
phpunit: true,
3119
)
3220
->withCache(

scripts/css-referential-generator

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ $missingNonStandardsAtRules = [
7373
'theme',
7474
'tailwind'
7575
];
76+
7677
foreach ($missingNonStandardsAtRules as $atRuleName) {
7778
if (isset($standardsAtRules[$atRuleName]) || isset($nonStandardsAtRules[$atRuleName])) {
7879
throw new Exception("At-rules $atRuleName already exists in either standards or non-standards at-rules.");
@@ -84,3 +85,31 @@ ksort($standardsAtRules);
8485
saveReferentialData(CssLint\Referential\Standard\AtRulesReferential::class, $standardsAtRules);
8586
ksort($nonStandardsAtRules);
8687
saveReferentialData(CssLint\Referential\NonStandard\AtRulesReferential::class, $nonStandardsAtRules);
88+
89+
$cssAtRulesPropertiesFile = __DIR__ . '/../tests/fixtures/css-at-rules-properties.json';
90+
$cssAtRulesProperties = json_decode(file_get_contents($cssAtRulesPropertiesFile), true);
91+
$standardsAtRulesProperties = [];
92+
$nonStandardsAtRulesProperties = [];
93+
94+
foreach ($cssAtRulesProperties as $atRuleName => $atRule) {
95+
foreach ($atRule as $propertyName => $property) {
96+
$isStandard = $property['standard'] ?? false;
97+
if ($isStandard) {
98+
$standardsAtRulesProperties[$atRuleName][$propertyName] = true;
99+
} else {
100+
$nonStandardsAtRulesProperties[$atRuleName][$propertyName] = true;
101+
}
102+
}
103+
}
104+
105+
ksort($standardsAtRulesProperties);
106+
foreach ($standardsAtRulesProperties as $atRuleName => $properties) {
107+
ksort($standardsAtRulesProperties[$atRuleName]);
108+
}
109+
saveReferentialData(CssLint\Referential\Standard\AtRulesPropertiesReferential::class, $standardsAtRulesProperties);
110+
111+
ksort($nonStandardsAtRulesProperties);
112+
foreach ($nonStandardsAtRulesProperties as $atRuleName => $properties) {
113+
ksort($nonStandardsAtRulesProperties[$atRuleName]);
114+
}
115+
saveReferentialData(CssLint\Referential\NonStandard\AtRulesPropertiesReferential::class, $nonStandardsAtRulesProperties);

scripts/css-referential-scraper

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ $cssAtRulesFile = __DIR__ . '/../tests/fixtures/css-at-rules.json';
2222
$scraper->saveToJson($referentials['at-rules'], $cssAtRulesFile);
2323
echo "Saved to {$cssAtRulesFile}\n";
2424

25+
echo "Fetched " . count($referentials['at-rules-properties']) . " at-rule property(s)\n";
26+
$cssAtRulesPropertiesFile = __DIR__ . '/../tests/fixtures/css-at-rules-properties.json';
27+
$scraper->saveToJson($referentials['at-rules-properties'], $cssAtRulesPropertiesFile);
28+
echo "Saved to {$cssAtRulesPropertiesFile}\n";
29+
2530
echo "Done.\n";

src/CssLint/CharLinter/CharLinter.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/CssLint/CharLinter/CommentCharLinter.php

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/CssLint/CharLinter/EndOfLineCharLinter.php

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/CssLint/CharLinter/ImportCharLinter.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)