Skip to content

Model 5 fixer configs in blink instead of ignoring them - #208

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-model-fixer-configs
Oct 14, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-model-fixer-configs

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Problem

A blink run on an ECS config reports some rules as:

blink: 5 configured ECS rule(s) applied with blink's built-in behaviour (config not modelled):
    - PhpCsFixer\Fixer\ClassNotation\ModifierKeywordsFixer
    - PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer
    - PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer
    - PhpCsFixer\Fixer\NamespaceNotation\BlankLinesBeforeNamespaceFixer
    - PhpCsFixer\Fixer\Operator\OperatorLinebreakFixer

These 5 fixers did not implement ConfigurableFixer, so their options (even the resolved defaults php-cs-fixer dumps) were dropped and reported as ignored.

Change

Each fixer now implements ConfigurableFixer and honors its php-cs-fixer options:

  • modifier_keywords: elements subset (const / property / method)
  • single_import_per_statement: group_to_single_imports - the default (true) now expands brace group imports use A\{B, C};; false keeps the group
  • nullable_type_declaration: syntax: union rewrites ?T to T|null
  • blank_lines_before_namespace: min_line_breaks / max_line_breaks
  • operator_linebreak: only_booleans and position: end

With these wired up, resolveECS resolves the config instead of adding them to ConfigIgnored.

Tests

Added a _config_test.go per fixer covering default and non-default options; full go test ./... passes.

blink reported these as applied with built-in behaviour (config not
modelled): make each a ConfigurableFixer honoring its php-cs-fixer options.

- modifier_keywords: elements subset (const/property/method)
- single_import_per_statement: group_to_single_imports (default expands groups)
- nullable_type_declaration: syntax union (?T -> T|null)
- blank_lines_before_namespace: min_line_breaks / max_line_breaks
- operator_linebreak: only_booleans and position=end
@TomasVotruba
TomasVotruba force-pushed the blink-model-fixer-configs branch from e013597 to 244e56a Compare October 14, 2026 08:50
@TomasVotruba
TomasVotruba merged commit f6ad829 into main Oct 14, 2026
20 checks passed
@TomasVotruba
TomasVotruba deleted the blink-model-fixer-configs branch October 14, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant