Skip to content

Chore/per cs formatting - #3263

Draft
adenwuts wants to merge 3 commits into
Novik:masterfrom
adenwuts:chore/per-cs-formatting
Draft

adenwuts wants to merge 3 commits into
Novik:masterfrom
adenwuts:chore/per-cs-formatting

Conversation

@adenwuts

@adenwuts adenwuts commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Initialises a conservative php-cs-fixer configuration to enable consistent code-styling in the code-base, applies that styling, and adds the commit hash to .git-blame-ignore-revs so that git blames aren't completely annihilated.

aden added 3 commits September 7, 2026 08:40
Phase 1 of applying consistent 'best-practice' formatting rules to the
ruTorrent codebase. This is a conservative set (i.e. php-cs-fixer's
'risky' rules disabled) that we can expand on as necessary. No
particular fixes in mind, just trying to streamline the development
workflow as activity on the codebase picks back up.
Apply consistent formatting across the code-base
This should work automatically in github, but for local development will
require setting git config blame.ignoreRevsFile .git-blame-ignore-revs
@adenwuts

adenwuts commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

@xirvik, this obviously needs some more work from my end, but the bones are there for configuration and ignoring the formatting commits.

What's the rationale behind maintaining tests and compatibility for PHP 7.4? Its been end-of-life for almost 4 years. Happy to make another issue for that if you'd like.

edit: just opened #3264 to make this process less painful.

@adenwuts

adenwuts commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

I think I'm happy to let this sit as a draft until legacy PHP support is dropped - I'm not sure the complexity/benefit ratio is there while we're still supporting older PHP versions.

@xirvik

xirvik commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

I think I'm happy to let this sit as a draft until legacy PHP support is dropped - I'm not sure the complexity/benefit ratio is there while we're still supporting older PHP versions.

The problem with this approach is that .git-blame-ignore-revs is not automatically honored by git. You need blame.ignoreRevsFile explicitly enabled.

I was considering enabling it in CI so it's mandatory for new PRs at least, which would eventually lead to something decent with a real blame, but it would take quite a while for everything to be decent.

@adenwuts

Copy link
Copy Markdown
Contributor Author

@xirvik I'm not sure I see that much of an issue with the changed git blames, but that might just be a result of my own workflow. From my perspective it seems like one extra blame to jump through, though I can see how that might be annoying.

Happy to defer to you on this, both options seem reasonable to me.

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.

2 participants