Skip to content

Commit e1af7d2

Browse files
author
Greg Bowler
committed
docs: add documentation
1 parent 01365a4 commit e1af7d2

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

Diff for: README.md

+57-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,60 @@ PHP Mess Detector (PHPMD) takes a given PHP source code base and looks for sever
1313
Usage
1414
-----
1515

16-
// TODO
16+
```yaml
17+
name: CI
18+
19+
on: [push]
20+
21+
jobs:
22+
build-and-test:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
28+
- name: Composer install
29+
uses: php-actions/composer@v6
30+
31+
- name: PHP Mess Detector
32+
uses: php-actions/phpmd@v1
33+
with:
34+
php_version: 8.1
35+
path: src/
36+
output: text
37+
ruleset: test/phpmd/ruleset.xml
38+
```
39+
40+
Version numbers
41+
---------------
42+
43+
This action is released with semantic version numbers, but also tagged so the latest major release's tag always points to the latest release within the matching major version.
44+
45+
Please feel free to use `uses: php-actions/phpmd@v1` to always run the latest version of v1, or `uses: php-actions/[email protected]` to specify the exact release.
46+
47+
Inputs
48+
------
49+
50+
The following configuration options are available:
51+
52+
+ `version` - What version of PHPMD to use
53+
+ `php_version` - What version of PHP to use
54+
+ `vendored_phpmd_path` - Path to a vendored phpmd binary
55+
+ `path` - A php source code filename or directory. Can be a comma-separated string
56+
+ `ruleset` - A ruleset filename or a comma-separated string of rulesetfilenames
57+
+ `output` - A report format
58+
+ `minimumpriority` - rule priority threshold; rules with lower priority than this will not be used
59+
+ `reportfile` - send report output to a file; default to STDOUT
60+
+ `suffixes` - comma-separated string of valid source code filename extensions, e.g. php,phtml
61+
+ `exclude` - comma-separated string of patterns that are used to ignore directories. Use asterisks to exclude by pattern. For example *src/foo/*.php or *src/foo/*
62+
+ `strict` - also report those nodes with a @SuppressWarnings annotation
63+
+ `args` - Extra arguments to pass to the phpmd binary
64+
65+
If you require other configurations of PHPMD, please request them in the [Github issue tracker].
66+
67+
*****
68+
69+
If you found this repository helpful, please consider [sponsoring the developer][sponsor].
70+
71+
[Github issue tracker]: https://github.com/php-actions/phpmd/issues
72+
[sponsor]: https://github.com/sponsors/g105b

0 commit comments

Comments
 (0)