Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Ben Ramsey
Ben Ramsey
@ramsey@phpc.social  ·  activity timestamp yesterday

Are there any @phpcs sniffs available (maybe in third-party packages) that check for PER-CS 3.0 style?

I’m trying to avoid errors due to the abbreviated constructor (`{}`). So, if there’s a sniff just for that, I’d be happy. I’d prefer not to ignore all Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore errors.

#PHP #phpcs

  • Copy link
  • Flag this post
  • Block
PHP_CodeSniffer
PHP_CodeSniffer
@phpcs@phpc.social  ·  activity timestamp yesterday

@ramsey Not as far as I know, but please open issues (if these don't exist yet) for each thing which needs to be addressed.

A number of sniffs will likely get a `perCompatible` property which takes a version number and would allow those sniffs to adjust their behaviour if set.

There's a long-standing issue open about PER, with lots of people interested and some who volunteered to address it, but unfortunately, no significant progress is being made.

https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/29

  • Copy link
  • Flag this comment
  • Block
Ben Ramsey
Ben Ramsey
@ramsey@phpc.social  ·  activity timestamp yesterday

@phpcs I found a PR for PER-CS 3.0, but it was closed and mentions a separate PERCS repo that appears private, so I didn’t want to create churn by opening issues that are being addressed elsewhere. I’m just mainly looking for a stopgap while that other repo is being worked on. 😁

  • Copy link
  • Flag this comment
  • Block
PHP_CodeSniffer
PHP_CodeSniffer
@phpcs@phpc.social  ·  activity timestamp yesterday

@ramsey Yes, that other repo is private for now as there is nothing usable there yet.

One of the tasks for (future) maintainers of the PERCS repo would be to identify the "gaps", i.e. what sniffs are missing, what sniffs are close, but not exactly right to satisfy PER.

An issue like yours would fit into that category and would go into the main PHPCS repo.

The PER repo will only be rulesets + some tests to ensure that the PER standard is properly covered via the rulesets.

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.34 no JS en
Automatic federation enabled
Log in
Instance logo
  • Explore
  • About
  • Members
  • Code of Conduct