Skip to content

Commit 9a477ac

Browse files
authored
Merge pull request #9 from tommcfarlin/develop
Update Instructions and Contributions.
2 parents 1255a3b + 4d29bb7 commit 9a477ac

File tree

3 files changed

+31
-17
lines changed

3 files changed

+31
-17
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/) and to
55
[Keep a Changelog](http://keepachangelog.com).
66

7+
## 1.2.0 - 2020-07-31
8+
9+
### Update
10+
11+
- `CONTRIBUTING.md` with contributors
12+
- `README.md` with new links, versions of software, and instructions
13+
714
## 1.1.0 - 2016-11-17
815

916
### Fixed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [Jeremy Smith](https://github.com/jeremysawesome)
2+
- [Evan Mullins](https://github.com/circlecube)

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# PHP CodeSniffer and WordPress Coding Standards with VS Code
22

3-
_Last Updated 2016-11-17 by @tommcfarlin_
3+
_Last Updated 2020-07-31 by @tommcfarlin_
44

55
This guide is meant to provide all of the steps necessary to easily get up and running with PHP CodeSniffer, the WordPress Coding Standard ruleset, and Visual Studio Code.
66

7-
![Visual Studio Code](https://camo.githubusercontent.com/531b31da15d5925c915c6b6ceea25c55171aa139/687474703a2f2f642e70722f692f537344552b)
7+
![Visual Studio Code](https://tommcfarlin.com/wp-content/uploads/2020/07/visual-studio-code-974x1024.png)
88

99
All of the resources used in this guide are linked at the bottom. This guide is also licensed [MIT](https://github.com/tommcfarlin/phpcs-wpcs-vscode/blob/master/LICENSE). If you'd like to contribute, then please feel free to open issues or issue pull requests. I'll be happy to merge them and also add your username to [CONTRIBUTING](https://github.com/tommcfarlin/phpcs-wpcs-vscode/blob/master/CONTRIBUTING.md).
1010

11-
If you're looking for a corresponding blog post, please see [this page](https://tommcfarlin.com/php-codesniffer-in-visual-studio-code).
11+
If you're looking for corresponding blog posts, please see:
12+
1. [Setting Up PHP CodeSniffer in Visual Studio Code](https://tommcfarlin.com/php-codesniffer-in-visual-studio-code)
13+
2. [Setting Up PHP CodeSniffer Per Project](https://tommcfarlin.com/php-codesniffer-per-project/)
1214

1315
As always, don't forget to checkout the [CHANGELOG](https://github.com/tommcfarlin/phpcs-wpcs-vscode/blob/master/CHANGELOG.md) to track everything that's changed since the initial release of this guide.
1416

@@ -26,14 +28,14 @@ $ php -v
2628
And you should see something like this:
2729

2830
```
29-
PHP 5.6.25 (cli) (built: Sep 6 2016 16:37:16)
30-
Copyright (c) 1997-2016 The PHP Group
31-
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
31+
PHP 7.4.7 (cli) (built: Jun 12 2020 00:04:10) ( NTS )
32+
Copyright (c) The PHP Group
33+
Zend Engine v3.4.0, Copyright (c) Zend Technologies
34+
with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans
35+
with Zend OPcache v7.4.7, Copyright (c), by Zend Technologies
3236
```
3337

34-
If you're looking for how to use a different version of PHP installed elsewhere on your system,
35-
this is not the guide for that. If, however, you're curious as to _where_ the version of PHP you're
36-
using is stored, you can enter:
38+
If you're looking for how to use a different version of PHP installed elsewhere on your system, this is not the guide for that. If, however, you're curious as to _where_ the version of PHP you're using is stored, you can enter:
3739

3840
```
3941
$ which php
@@ -42,15 +44,14 @@ $ which php
4244
And you should see something similar to this:
4345

4446
```
45-
/usr/bin/php
47+
/usr/local/bin/php
4648
```
4749

4850
That should give you enough information for the rest of this guide.
4951

5052
## 2. Installing Composer
5153

52-
Installing Composer globally means that you'll be able to access it from anywhere on your system (that is, in any directory regardless of where you are). To do this, you can read the [manual](https://getcomposer.org/doc/00-intro.md) or follow the quick steps below (which summarize the
53-
manual, anyway):
54+
Installing Composer globally means that you'll be able to access it from anywhere on your system (that is, in any directory regardless of where you are). To do this, you can read the [manual](https://getcomposer.org/doc/00-intro.md) or follow the quick steps below (which summarize the manual, anyway):
5455

5556
1. Grab [the latest snapshot](https://getcomposer.org/composer.phar) of Composer. Save it somewhere you'll remember.
5657
2. Move the file you just downloaded to the `/usr/local/bin/` directory on your machine.
@@ -84,16 +85,16 @@ For the purposes of this document, we're installing PHP CodeSniffer on a project
8485
From the integrated terminal within Visual Studio Code, enter the following command:
8586

8687
```
87-
$ composer require "squizlabs/php_codesniffer=2.*"
88+
$ composer require "squizlabs/php_codesniffer=3.*"
8889
```
8990

9091
This will create `composer.json`, tell it where to locate the PHP CodeSniffer, and install it in a `vendor` directory. Once this is done, we need the WordPress Coding Standard ruleset.
9192

9293
## 4. Installing the WordPress Coding Standards Rules
9394

94-
I recommend placing the rules in a directory you can refer to often. Personally, I use a `projects` directory in my Dropbox directory to manage all of my work because it obviously provides backups automatically (and no, I don't recommend storing secure files there).
95+
I recommend placing the rules in a directory you can refer to often. Personally, I use a `projects` directory to manage all of my work.
9596

96-
From within your directory of choice, say `dropbox/projects`, enter the following command in the terminal:
97+
From within your directory of choice, say `/projects`, enter the following command in the terminal:
9798

9899
```
99100
$ composer create-project wp-coding-standards/wpcs:dev-master --no-dev
@@ -121,8 +122,11 @@ Make sure the file looks like the following (though you may need to tweak based
121122
// Place your settings in this file to overwrite the default settings
122123
{
123124
// PHPCS
124-
"phpcs.enable": true,
125+
"phpcs.enable": true,
125126
"phpcs.standard": "WordPress",
127+
"phpcs.executablePath": "./vendor/bin/phpcs",
128+
"phpcs.showWarnings": true,
129+
"phpcs.composerJsonPath": "composer.json",
126130
}
127131
```
128132

@@ -136,4 +140,5 @@ ___
136140
- [The Latest Composer Snapshot](https://getcomposer.org/composer.phar)
137141
- [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
138142
- [WordPress Coding Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards)
139-
- [My corresponding blog post](https://tommcfarlin.com/php-codesniffer-in-visual-studio-code)
143+
- [Setting Up PHP CodeSniffer in Visual Studio Code](https://tommcfarlin.com/php-codesniffer-in-visual-studio-code)
144+
- [Setting Up PHP CodeSniffer Per Project](https://tommcfarlin.com/php-codesniffer-per-project/)

0 commit comments

Comments
 (0)