Brackets editor with git and phpcs for wordpress development
Setting up brackets editor with git and phpcs with wordpress coding standard etc
Brackets editor (brackets.io) is an editor that I’ve wanted to try out for a while now, but for it to be viable for me to use, I had to configure a few things:
git in brackets editor
I installed Brackets-git (file > extensions manager > search for git ) from https://github.com/zaggino/brackets-git
I set the command to show the git console to be CMD-; (file > git settings > shortcuts)
So that it mirrors the Ctrl+# that I use in eclipse on linux on my work pc.
phpcs in brackets editor with wordpress coding standards
This required a bit of configuring to get brackets editor with git and phpcs to work on mac osx:
Open the config.js file (help > show extensions folder > users > lintyai > right click on config.js > open in brackets)
I followed instructions from here:
Next up is to install phpcs and the wordpress coding standard in brackets.
As phpcs isnt included in osx, I instaled it like this:
# install phpcs and link it to your path
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs
git clone https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs
# tell phpcs about the wordpress coding standards
scripts/phpcs --config-set installed_paths ../wpcs
# add phpcs to your path
sudo ln -s ~/bin/phpcs/scripts/phpcs /usr/local/bin/phpcs
# we probably want to ignore the space indenting on the files
You can add your own excludes to the list, to suit.
Next, you can edit the config.js file and enable phpcs.
Find and uncomment the existing phpcs section, and add the following in place of the phpcs command: