Skip to content

Commit 3d6c602

Browse files
committed
Creating proper README.md file
1 parent 856a781 commit 3d6c602

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,48 @@
1-
# phpcs-diff
1+
# PHPCS Diff
2+
3+
The purpose of this project is to provide a mean of running PHPCS checks on top of file(s) stored in a version control system and reporting issues introduced only in specific revision(s).
4+
5+
Reporting only new issues for specific revision migth be important in case the PHPCS is being introduced later in the development cycle and there are no resources for cleaning up all existing issues.
6+
7+
# Installation
8+
9+
This project is now totally dependant on a WordPress installation and as it is now, it's meant to be installed as a [WP CLI](wp-cli.org) command.
10+
11+
Checkout this project to your theme or a plugin and include the `wp-cli-command.php` file for introducing a new command to your WP CLI.
12+
13+
You might want to conditionally include the file only in case the WordPress is loaded as part of WP CLI:
14+
15+
```
16+
if ( defined( 'WP_CLI' ) && WP_CLI ) {
17+
require_once( './wp-cli-command.php' );
18+
}
19+
```
20+
21+
# Configuration
22+
23+
This project still requires some manual updates to the code in order to make it working.
24+
25+
## SVN
26+
27+
You either need to hardcode SVN credentials to `PHPCS_Diff_SVN` class ( related code: https://github.com/Automattic/phpcs-diff/blob/master/class-phpcs-diff-svn.php#L5 ) or pass those via the `(array) $options` param to class' constructor from the WP CLI command - https://github.com/Automattic/phpcs-diff/blob/master/wp-cli-command.php#L64
28+
29+
## PHPCS
30+
31+
If default values for running PHPCS command does not match your environment (see https://github.com/Automattic/phpcs-diff/blob/master/class-phpcs-diff.php#L5 ), you either need to hardcode them to the `PHPCS_Diff` class, or pass those in the `(array) $options` param to class' constructor from the WP CLI command - https://github.com/Automattic/phpcs-diff/blob/master/wp-cli-command.php#L64
32+
33+
# Running the command
34+
35+
Example command run:
36+
37+
```
38+
wp phpcs-diff --repo="hello-dolly" --start_revision=99998 --end_revision=100000
39+
```
40+
41+
For more params of the command, please, see the code directly: https://github.com/Automattic/phpcs-diff/blob/master/wp-cli-command.php#L12
42+
43+
# TODO:
44+
45+
- [ ] Make configuration of the environment (phpcs command, standard's location, more repositories registration and svn credentials) easier than manually modificating the code
46+
- [ ] Create GitHub version control backend
47+
- [ ] Make the WP CLI command version control backend agnostic
48+

0 commit comments

Comments
 (0)