Giter Club home page Giter Club logo

allman_codesniffer's Introduction

Allman CodeSniffer

This is kind of a continuation from my previous fixer PHP_Allman, but this time is based on PHP_CodeSniffer, which is more powerful and flexible in my opinion.

The principles are the same, tho:

  1. I believe in Allman indent style.
  2. I believe in tabs instead of spaces.

The good thing now, is that if you don't like one of those you can customize it easier.

Install

Using composer:

composer require linnk/allman-codesniffer

Configuring Allman standard, you will need to add the whole path because it depends of the CakePHP standard in the repository:

vendor/bin/phpcs --config-set installed_paths vendor/linnk/allman-codesniffer/
vendor/bin/phpcs --config-set default_standard Allman

Usage:

$ vendor/bin/phpcs path/to/your/code

Global install

Using composer:

composer global require linnk/allman-codesniffer

Make sure you have ~/.composer/vendor/bin/ in your PATH, so you can run phpcs and phpcbf as a command line. Then, configure the Allman standard:

phpcs --config-set installed_paths ~/.composer/vendor/linnk/allman-codesniffer/
phpcs --config-set default_standard Allman

If everything is ok, you can check it “explaining” the default_standard:

phpcs -e

You should see the Allman standard definition at the beginning.

## Development

Clone it:

$ git clone https://github.com/Linnk/Allman_CodeSniffer.git

Compose it:

$ composer install

Configure it:

$ vendor/bin/phpcs --config-set installed_paths /full/path/to/Allman_CodeSniffer/
$ vendor/bin/phpcs --config-set default_standard Allman
$ vendor/bin/phpcs --config-set report_width auto

That's it.

allman_codesniffer's People

Contributors

linnk avatar nachitox avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.