Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #12 from WebDevStudios/feature/namespace-valid-dir
Browse files Browse the repository at this point in the history
Rename namespace so we can write custom sniffs
  • Loading branch information
JayWood authored Jun 23, 2017
2 parents da27f4e + 758bc84 commit 8d74156
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changes

When adding __any__ changes, each change must go through the following PR process:

- Branch off the latest release branch in development, e.g. `release-x.x`
- Add your changes
- Document your changes in `README.md` under the release changelog, and link to your issue or PR
- Submit PR against the release branch (if your PR is not entirely complete, add the `Not Ready` label and it will be ignored until you remove it)
- Add the PR to the release milestone too
- PR must be tested at least against Sublime, Atom, PHP Storm, and CLI; there are labels for each of these and must have them all (request this from other users of these editors, or some may volunteer)
- Once the PR has been tested in all editors, a complete review from a Senior Developer and a Lead is required (Add the `Lead/Senior Review Needed` label so we can notice those, remove this label when the two reviews are done)
- Once your PR has the correct number of votes, and is fully reviewed, it can only be merged into `master` by a lead (add the `Ready For Lead Merge` label when it's ready for this, or the lead can just merge it right in)

# Additional Approval of New Rules

Changes that introduce new rules require at least 5 votes/blessings. Two of them
must be from a lead. Once a new rule has these 5 votes, add the `Approved Rule`
label and it can be merged in immediately if it's been tested in the above
editors.
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
A repository to house all our linting and coding standards.

## PHP Code Sniffer
The PHP CS ruleset exists under the `/WebDevStudios-phpcs` folder of the repo, this is so later we can add custom sniffs, and maybe even dependant rulesets.

The PHP CS ruleset exists under the `/WebDevStudios` folder of the repo, this is so later we can add custom sniffs, and maybe even dependant rulesets.

### Installation

* Clone the repo to your desired location
* Check if you already have `installed_paths` set by running `phpcs --config-show`

__(Example output)__
#### Example output

```
$> phpcs --config-show
installed_paths: /home/wpcs
Expand All @@ -18,20 +21,37 @@ installed_paths: /home/wpcs
* Set your installed standards path(s).

```
phpcs --config-set installed_paths /home/WDS-Coding-Standards/WebDevStudios-phpcs
phpcs --config-set installed_paths /home/WDS-Coding-Standards/WebDevStudios
```

If you alread had an installed path, just add that with a comma

```
phpcs --config-set installed_paths /home/WDS-Coding_Standards/WebDevStudios-phpcs,/home/wpcs
phpcs --config-set installed_paths /home/WDS-Coding_Standards/WebDevStudios,/home/wpcs
```

* Confirm your installation is complete

```
$> phpcs -i
The installed coding standards are PSR1, Squiz, MySource, PSR2, Zend, PEAR, PHPCS, WebDevStudios-phpcs, WordPress-Core, WordPress-VIP, WordPress-Extra, WordPress-Docs and WordPress
The installed coding standards are PSR1, Squiz, MySource, PSR2, Zend, PEAR, PHPCS, WebDevStudios, WordPress-Core, WordPress-VIP, WordPress-Extra, WordPress-Docs and WordPress
```

> Full list of [Configuration Options](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) over at the PHP_CodeSniffer wiki.
____________________

# Changelog

## 1.0.1

- Changed `WebDevStudios-phpcs` to just `WebDevStudios` for compatibility with namespaces and new sniffs added later [#12](https://github.com/WebDevStudios/WDS-Coding-Standards/pull/12)
- Inclusion of the `WordPress-Docs` ruleset

Note, this release breaks some things. When you update to this version,
you will need to update your coding standard to `WebDevStudios` vs the old
`WebDevStudios-phpcs` which should no longer work.

## 1.0

- Initial ruleset based on WordPress-Extra
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="WebDevStudios Coding Standards">
<ruleset name="WebDevStudios">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml -->
<!-- See https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/WordPress-Core/ruleset.xml -->

Expand All @@ -15,6 +15,9 @@
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing.AssociativeKeyFound" />
</rule>

<!-- Include WordPress-Docs -->
<rule ref="WordPress-Docs"/>

<!-- Doc block alignments -->
<rule ref="Squiz.Commenting.DocCommentAlignment" />

Expand Down

0 comments on commit 8d74156

Please sign in to comment.