File tree Expand file tree Collapse file tree 2 files changed +71
-4
lines changed
Expand file tree Collapse file tree 2 files changed +71
-4
lines changed Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 33version ?= 0.2.0
44branch ?= 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
1010ifndef path
@@ -73,7 +73,7 @@ code.fix.diff:
7373# #
7474code.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"'
You can’t perform that action at this time.
0 commit comments