Coding and contributing guidelines for Roots projects
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.travis.yml
CONTRIBUTING.md
README.md
ruleset.xml

README.md

Roots Coding and Contributing Guidelines

PHP

PSR-2 coding style with the following changes:

  • 2 spaces indentation
  • Opening and closing braces for functions and classes forced on the same line
  • Forced newline after opening brace

Additional rules:

  • Use Roots\ namespace
  • Use short array syntax
  • Use short echo syntax

You can check if your contribution passes the styleguide by installing PHP CodeSniffer and running the following in your project directory:

phpcs --standard=ruleset.xml --extensions=php --ignore=node_modules,bower_components,vendor -n -s .

JavaScript

Every JavaScript contribution is run against the Google JavaScript Styleguide. You can check if your contribution passes the styleguide by installing JSCS and running the following in your project directory:

npm run jscs