Skip to content

Commit 7ca42e2

Browse files
committed
chor: Fill readme and update config.publish command
1 parent 3b7f589 commit 7ca42e2

File tree

2 files changed

+71
-4
lines changed

2 files changed

+71
-4
lines changed

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
# dockerize-php-code-analysis
1+
# Dockerized PHP Code Analysis Tool
2+
3+
This dockerized tool provides you Makefile commands to check and fix PHP code.
4+
It's built on top of https://github.com/easy-coding-standard/easy-coding-standard library
5+
and uses some other supported packages to cover as many rules as possible.
6+
7+
## Installation
8+
1. Download [code.mk](./bin/code.mk)
9+
2. Include `code.mk` in your `Makefile`
10+
```makefile
11+
include code.mk
12+
```
13+
3. Use :)
14+
15+
## Usage
16+
This tool uses `code.` namespace for all the commands it provides.
17+
Use `make help` if available in your project to see for available commands.
18+
You can see details in `code.mk` file to be aware of all available commands.
19+
20+
#### Check code
21+
```shell
22+
make code.check
23+
```
24+
25+
```shell
26+
make code.check path=src/app/Http
27+
```
28+
29+
```shell
30+
make code.check.dirty
31+
```
32+
33+
```shell
34+
make code.check.diff
35+
```
36+
37+
```shell
38+
make code.check.diff branch=main
39+
```
40+
41+
#### Fix code
42+
```shell
43+
make code.fix
44+
```
45+
46+
```shell
47+
make code.fix path=src/app/Http
48+
```
49+
50+
```shell
51+
make code.fix.dirty
52+
```
53+
54+
```shell
55+
make code.fix.diff
56+
```
57+
58+
```shell
59+
make code.fix.diff branch=main
60+
```
61+
62+
#### Configure checker
63+
64+
1. Publish the config
65+
```shell
66+
make code.config.publish
67+
```
68+
2. Modify `ecs.php` file to fit your needs.

bin/code.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
version ?= 0.2.0
44
branch ?= develop
55

6-
#ECS_IMAGE := hub.jcdev.net:24000/php-code-analysis-tool:${version}
7-
ECS_IMAGE := docker.io/library/dockerize-php-code-analysis-php-code-analysis-tool
6+
ECS_IMAGE := hub.jcdev.net:24000/php-code-analysis-tool:${version}
7+
#ECS_IMAGE := docker.io/library/dockerize-php-code-analysis-php-code-analysis-tool
88

99
# Define default path if one is not passed
1010
ifndef path
@@ -73,7 +73,7 @@ code.fix.diff:
7373
##
7474
code.config.publish:
7575
@echo '...........Publishing config'
76-
@$(eval CONTAINER_ID = $(shell docker create hub.jcdev.net:24000/php-code-analysis-tool:latest))
76+
@$(eval CONTAINER_ID = $(shell docker create ${ECS_IMAGE}))
7777
@docker cp ${CONTAINER_ID}:/app/ecs.php ecs.php
7878
@docker rm -v ${CONTAINER_ID}
7979
@echo '...........Published "ecs.php"'

0 commit comments

Comments
 (0)