jimrubenstein / simple-php-cs-fixer

A VS Code extension for simple php-cs-fixer integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simple-php-cs-fixer README

None of the other php-cs-fixer extensions worked the way I wanted them to. I basically want something that runs php-cs-fixer exactly as I would from the command line, but with an option for custom config, and running on save.

Installation

  1. git clone git@github.com:jimrubenstein/simple-php-cs-fixer.git ~/.vscode/extensions/jimrubenstein.simple-php-cs-fixer

  2. Reload VSCode

** Note ** : Package requires the php-cs-fixer utility to be installed. Instructions available here: github.com/FriendsOfPHP/PHP-CS-Fixer

Demo Gif


The Command:

simple-php-cs-fixer.fix


Config:

Look for a custom project specific config file?

"simple-php-cs-fixer.useConfig": true

The path to that config file. (relative to the project root)

"simple-php-cs-fixer.config": ".php_cs.dist"

Run the fixer on save?

"simple-php-cs-fixer.save": true

Run the fixer on save, only for projects which have your configuration file present on the project root?

"simple-php-cs-fixer.save": "auto" (This requires a value to be present for the "simple-php-cs-fixer.config" option)

Whether php-cs-fixer should be using a cache

"simple-php-cs-fixer.usingCache": false

A comma separated list of rules to be used by php-cs-fixer

"simple-php-cs-fixer.rules": "@PSR1,@PSR2,trailing_comma_in_multiline_array"


- Enjoy!

About

A VS Code extension for simple php-cs-fixer integration


Languages

Language:PHP 50.6%Language:JavaScript 49.4%