chore: adopt clang-format and pre-commit #1128
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1128"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by prompterror on 2026-10-07T13:16:26Z.
What
Adopts a formatting/tooling baseline for the whole tree so style is enforced mechanically instead of by review:
.clang-format— LLVM base + deliberate deviations, all documented in the file:IndentWidth: 4(the tree is 4-space indented),ColumnLimit: 120(long shader-dump/profile lines are atomic; the tree already has 500-char lines),PointerAlignment: Left(matches the tree),SortIncludes: Never(include order is load-bearing here),FixNamespaceComments: false..editorconfig— LF, UTF-8, 4-space indent, final newline, no trailing whitespace; mirrors the hooks..pre-commit-config.yaml—pre-commit/pre-commit-hooksv6.0.0 (trailing-whitespace, end-of-file-fixer, check-yaml, check-merge-conflict, check-case-conflict, check-added-large-files, check-executables-have-shebangs, mixed-line-ending → LF) andpre-commit/mirrors-clang-formatv21.1.8. Vendored code under3rdparty/is excluded from every hook..github/workflows/pre-commit.yml— CI job that runspre-commit run --all-fileson push tomainand on pull requests, matching the existing Build workflow's checkout conventions.CONTRIBUTING.md— documentspre-commit installand the format requirement.core/—clang-format -i(21.1.8, the pinned revision). Mechanical: line-wrapping at 120 columns, brace/indent normalization, single-statement blocks. No semantic changes (the working tree before this commit was already hook-clean, so CI--all-filespasses).The reformatting commit includes
GuestMemory.cpp/ShaderMemory.cpp, which #1114 also touches — whichever merges second needs only a trivial rebase (git clang-formatcan't auto-merge formatting-only hunks, but the conflict is mechanical).Testing
pre-commit run --all-filespasses locally with the pinned revisions (provides the exact baseline CI will check).if (x) return y;→ two lines, one( "typo in a profile string).Note: CI runs on this fork PR are held by the first-time-contributor approval gate until a maintainer approves once (same as #1114).
Written with AI assistance; the config deviations and the baseline are reviewed per CONTRIBUTING.md.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T13:55:00Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)sceNgs2PanGetVolumeMatrixsceNpEntitlementAccessAbortRequestsceNpEntitlementAccessDeleteRequestasctime_nid_postfixgmtime_nid_postfixlibc_mktime_nid_postfixlocaltime_nid_postfixmktime_nid_postfixsceKernelConvertLocaltimeToUtcImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T07:56:19Z.
Thanks for the work here. This is a tree-wide policy change, so it needs a maintainer decision before a code review:
main, and #1114 hit the same onGuestMemory.cpp/ShaderMemory.cpp). If accepted, it would need a merge window where open PRs are rebased/merged first, or agit blameignore-revs file plus formatting only changed lines (git clang-format) as the CI check.mainand keep the baseline reformat in a separate PR from the config/CI files, so the config can be discussed without a 80k-line diff.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T09:21:54Z.
No from me: there's no formatter rule in CONTRIBUTING, and a whole-tree reformat would conflict with almost every open PR. I'd close this unless the owner wants one.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T22:30:51Z.
Closing: a whole-tree reformat conflicts with nearly every open pull request, and we don't want a formatter rule for now. Thanks for the work on it.
Pull request closed