Skip to content

feat: adopt nextcloud/coding-standard, NC 34 and the .editorconfig — the fleet migration recipe - #142

Open
rubenvdlinde wants to merge 5 commits into
developmentfrom
feat/nextcloud-coding-standard
Open

feat: adopt nextcloud/coding-standard, NC 34 and the .editorconfig — the fleet migration recipe#142
rubenvdlinde wants to merge 5 commits into
developmentfrom
feat/nextcloud-coding-standard

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Proves the whole migration recipe end-to-end before it touches 18 apps. The template is what new apps are cut from, so it goes first and this diff is the recipe.

Policy: Conduction code must pass Nextcloud's own checks unchanged. We may be stricter, never different.

Measured, in php:8.3-cli, installing from vendor/

before after
php-cs-fixer (Nextcloud's standard) 22 of 22 files fail Found 0 of 22
phpcs (semantic-only ruleset) red on main 34 findings, all @spec warnings — zero errors, zero formatting sniffs
quality / PHP Quality (phpcs) in CI ❌ failing passing

That third row is the real result: the same job that failed on the base branch passes here.

Three commits, deliberately separated

  1. config.php-cs-fixer.dist.php, conduction/coding-standard, phpcs.xml reduced to a 12-line stub, .editorconfig, NC 34, stylelint glob
  2. reformatcomposer cs:fix, whitespace only
  3. blame-ignore.git-blame-ignore-revs naming commit 2

Reviewing commit 2 line by line is not useful; commit 1 is the review.

What changed and why

  • cs:check / cs:fix now actually run php-cs-fixer. They were aliases for phpcs/phpcbf, so the documented Nextcloud command reformatted code away from Nextcloud's standard.
  • nextcloud/coding-standard dropped as a direct dep — it arrives transitively at a version conduction/coding-standard has tested against. It was previously declared with no config file and no invocation anywhere.
  • phpcs-custom-sniffs/ deleted — the three sniffs come from vendor/ now. The fleet was carrying six divergent copies of NamedParametersSniff.php, a custom rule.
  • .editorconfig copied verbatim from nextcloud/server. No fleet app had one, so editors defaulted to whatever the developer last worked in — usually tabs, which the old ruleset then rejected.
  • NC 34: nextcloud/ocp ^31.0^34.0, info.xml min-version="28"32, test refs → ["stable34"]. The app declared support for 34 and was analysed against 31 — a removal in 32/33/34 was invisible to the type checker.
  • stylelint glob quoted and widened to "src/**/*.{vue,scss,css}". Unquoted, the shell expands it and without globstar src/**/ matches one directory level. Verified with real files: recursive matching finds src/deep/nested/probe.css and src/shallow.css that the old form misses.

Blame

.git-blame-ignore-revs names the reformat commit. Measured on lib/AppInfo/Application.php: 54 lines attributed to the reformat without the ignore file, 0 with it. GitHub honours the file automatically; locally it needs git config blame.ignoreRevsFile .git-blame-ignore-revs once.

Expected failures

Base development already fails 12 quality jobs. This PR does not fix those and is not trying to. Moving to NC 34 and Psalm will surface more — that is the intent.

Blocked on

ConductionNL/.github#375conduction/hydra-gates is pinned to that feature branch and becomes ^1.0 on merge.


Replaces #141, which was cut from main and would have dragged 6 unrelated commits into a development PR.

…he stylelint glob

Config only. The reformat is the NEXT commit on purpose, so that
.git-blame-ignore-revs can name a commit that contains nothing but whitespace.
…behaviour change

Applied by `composer cs:fix`. Tabs, same-line braces, `(int)$x`, `'a' . 'b'`,
ordered imports — Nextcloud's dialect, which this app now passes unchanged.

Isolated from the configuration change on purpose so .git-blame-ignore-revs can
name a commit that touches nothing but formatting. Reviewing it line by line is
not a useful activity; the useful review is the previous commit.
96b2382 touches ~22 files and changes no behaviour. Without this, every line it
reflowed attributes to it and the real author is one --skip away.

GitHub honours the file automatically; locally it needs
`git config blame.ignoreRevsFile .git-blame-ignore-revs` once.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ 28a0710

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-specs
check-manifest
composer
npm ✅ 738/738
PHPUnit
Newman
Playwright
Hydra gates

Quality workflow — 2026-08-12 09:20 UTC

Download the full PDF report from the workflow artifacts.

This repo pinned hydra-gates-ref: v1.3.0. gate-65, added in
ConductionNL/.github#375, flags it, and it is right to: a pin is a silent expiry
date. 22 repos once sat on v1.0.1 while 16 gates were dead fleet-wide and every
one reported PASS (.github#159); a default later flipped at @main then reached
those same old runners and turned them red on gates they had no subject matter
for (#173). Both directions come from the two halves of one system moving
independently.

The shared workflow is consumed at @main, so the gate package must be too — then
a gate fix reaches this repo with no commit in this repo.

conduction/hydra-gates is still constrained to dev-feat/centralised-quality-config
in composer.json, which gate-65 also flags, correctly. That one becomes ^1.0 when
#375 merges.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ f096f4c

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-specs
check-manifest
composer ✅ 103/103
npm ✅ 738/738
PHPUnit
Newman
Playwright
Hydra gates

Quality workflow — 2026-08-12 09:35 UTC

Download the full PDF report from the workflow artifacts.

ConductionNL/.github#375 is merged and tagged v1.7.0, so the temporary
dev-feat/centralised-quality-config constraint can go — along with the VCS
repositories block, since both packages are on Packagist now.

gate-65 reported two findings on this branch and now reports none: 15 rules
checked, zero deviations. The gate found its own author's pins first, which is
the behaviour you want from it.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/nextcloud-app-template @ 92096fa

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-specs
check-manifest
composer
npm ✅ 738/738
PHPUnit
Newman
Playwright
Hydra gates

Quality workflow — 2026-08-12 09:43 UTC

Download the full PDF report from the workflow artifacts.

This was referenced Aug 12, 2026
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