Skip to content
Nate Devereux edited this page Dec 7, 2023 · 22 revisions

Silverstripe Backend Standards for the Bespoke Squads.
This package contains some tools and a predefined ruleset that we use in our Silverstripe Bespoke teams

This package also utilises the following third-party tools:

Goal πŸ†

What is the Goal of this module?

Simply put, this module aims to centralize, maintain and handle all the details relating to coding standards for the Silverstripe Bespoke teams.

A fully implemented code base will have no specifics about coding standards present within it.

Currently, this is focusing on PHP with a Silverstripe framework in mind.

This may change in the future. πŸš€

Installation πŸ—οΈ

You'll find more detailed instructions on the installation page

A note for Silverstripe staff

⚠️ If you're a Silverstripe staff member and looking to add this to an existing project please check out the details on confluence for specific instructions for our projects

Usage πŸ›Έ

These scripts are as follows:

Check if the code complies with the Silverstripe Bespoke Coding Standards.

vendor/bin/bespoke-phpcs

Fix errors automatically, where possible. (using phpcbf under the hood)

vendor/bin/bespoke-phpcbf

Check the syntax of PHP files.

vendor/bin/bespoke-lint

In most cases, these will already be configured (See installation for an example) in the composer.json scripts area and can be run as per the table below.

type code sniff code fix code lint
raw command vendor/bin/bespoke-phpcs vendor/bin/bespoke-phpcbf vendor/bin/bespoke-lint
composer equivalent composer run phpcs composer run phpcbf composer run php-lint

Maintainers πŸ€“

  • Silverstripers! πŸ’– (That's you if you're reading this!)

Contribution πŸ’ž

  • Anyone is welcome to contribute to the package and open Pull Request.
  • Pull requests will only be approved by a Principal Dev/Tech Leads