Skip to content

style(lint): apply phpcbf auto-fixes and ignore line-length warnings#150

Closed
ginkelsoft-development wants to merge 1 commit into
developfrom
chore/fix-psr12-violations
Closed

style(lint): apply phpcbf auto-fixes and ignore line-length warnings#150
ginkelsoft-development wants to merge 1 commit into
developfrom
chore/fix-psr12-violations

Conversation

@ginkelsoft-development

Copy link
Copy Markdown
Owner

Probleem

composer lint faalde op develop met pre-existing PSR-12 issues. Hierdoor was elke nieuwe PR rood op CI, ook PRs die zelf geen lint-issues introduceren.

Wijzigingen

1. composer lint:fix toegepast

Zes auto-fixable PSR-12 violations zijn opgelost door phpcbf. Pure formatting — geen gedragsverandering.

Bestanden:

  • src/Commands/InstallBuildoraCommand.php
  • src/Commands/UpgradeBuildoraCommand.php
  • src/Datatable/DataFetcher.php
  • src/Http/Controllers/InlineRelationController.php
  • src/Http/Controllers/InstallController.php
  • src/Resources/Defaults/UserBuildora.php

Type fixes: 'blank line at end of control structure', misplaced closing parenthesis. Allemaal [x] markers in de phpcs output.

2. Generic.Files.LineLength uitgesloten

PSR-12's 120-char limit is een soft limit. Diverse bestaande regels in deze codebase zijn langer (148, 151, 203 chars). Het zijn waarschuwingen — geen errors — maar phpcs returned exit code 1 ook bij warnings.

In plaats van honderden regels te knippen, sluiten we deze sniff uit:

```json
"lint": "vendor/bin/phpcs --standard=PSR12 --exclude=Generic.Files.LineLength src/",
"lint:fix": "vendor/bin/phpcbf --standard=PSR12 --exclude=Generic.Files.LineLength src/",
```

Verificatie

  • composer lint → exit 0
  • composer test → tests groen
  • Diff blijft minimaal (15 regels totaal)
  • Geen behaviour changes in src/

Effect op andere PRs

Na merge zullen de CI runs op #144, #146, #147, #148 en #149 ook groen worden op de lint check (op next push).

Two related cleanups so PRs stop failing on pre-existing lint noise:

1. Run phpcbf — applies the 6 auto-fixable PSR-12 violations that
   already existed on develop (mostly 'blank line at end of control
   structure' and a misplaced closing parenthesis). Pure formatting,
   no behaviour change.

2. Exclude Generic.Files.LineLength from the lint command. PSR-12's
   120-char rule is a soft limit and a number of existing lines run
   long. Letting it block CI was producing noise rather than signal.

After this:
- composer lint exits 0 on develop
- All open PRs that were red only on lint will turn green on next push

Refs CI hardening (#117 follow-up).
@ginkelsoft-development

Copy link
Copy Markdown
Owner Author

Vervangen door #157 (consolidated lint fix). Die PR fixt zowel de pre-existing phpcbf errors als de warning-as-failure issue in de CI workflow.

ginkelsoft-development added a commit that referenced this pull request May 12, 2026
Two layered fixes so the Code Quality workflow stops failing on every PR:

1. .github/workflows/lint.yml — pass --warning-severity=0 to phpcs.
   PSR-12's 120-character line limit is documented as a soft cap and
   several existing lines run long; treating them as warnings rather
   than failures keeps the cosmetic feedback visible locally without
   blocking CI.

2. Six pre-existing PSR-12 errors (blank-line-at-end-of-control, mis-
   placed parenthesis) auto-fixed by phpcbf. These were the errors
   that, combined with the warning treatment, made phpcs exit 1 even
   on a clean run.

3. phpcs.xml.dist — same ruleset definition for local use, so devs
   running 'vendor/bin/phpcs' (without --standard) get the same
   behaviour as CI. Includes a comment explaining the line-length
   exclude.

This supersedes #150 (which only fixed the phpcbf side but didn't
solve the warning-on-exit issue). Closing #150 in favour of this PR.

Verified:
- vendor/bin/phpcs --standard=PSR12 --warning-severity=0 src/ exits 0
- composer test still green
ginkelsoft-development added a commit that referenced this pull request May 12, 2026
Two layered fixes so the Code Quality workflow stops failing on every PR:

1. .github/workflows/lint.yml — pass --warning-severity=0 to phpcs.
   PSR-12's 120-character line limit is documented as a soft cap and
   several existing lines run long; treating them as warnings rather
   than failures keeps the cosmetic feedback visible locally without
   blocking CI.

2. Six pre-existing PSR-12 errors (blank-line-at-end-of-control, mis-
   placed parenthesis) auto-fixed by phpcbf. These were the errors
   that, combined with the warning treatment, made phpcs exit 1 even
   on a clean run.

3. phpcs.xml.dist — same ruleset definition for local use, so devs
   running 'vendor/bin/phpcs' (without --standard) get the same
   behaviour as CI. Includes a comment explaining the line-length
   exclude.

This supersedes #150 (which only fixed the phpcbf side but didn't
solve the warning-on-exit issue). Closing #150 in favour of this PR.

Verified:
- vendor/bin/phpcs --standard=PSR12 --warning-severity=0 src/ exits 0
- composer test still green
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