forked from Space48/magento2-code-quality
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrumphp.yml
107 lines (104 loc) · 3.59 KB
/
grumphp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
## rewrite classes to format output to have rule names in it
services:
formatter.phpmd:
class: \Space48\CodeQuality\Formatter\PhpmdFormatter
formatter.phpcs:
class: \Space48\CodeQuality\Formatter\PhpcsFormatter
GrumPHP\Task\PhpMd:
## rewrite class to whitelist 'xml' format
class: \Space48\CodeQuality\Task\PhpMd
## set 'phpmd' formatter for PhpMd Task
arguments:
- '@process_builder'
- '@formatter.phpmd'
tags:
- { name: grumphp.task, task: phpmd }
## workaround to add '-s' option to PhpCs Task
process_builder:
class: \Space48\CodeQuality\Process\ProcessBuilder
arguments:
- '@GrumPHP\Locator\ExternalCommand'
- '@grumphp.io'
- '@GrumPHP\Configuration\Model\ProcessConfig'
public: true
## workaround to remove 'commit-msg' git hook (it may fail in warden if .git is not synced inside container)
## (remove on non warden environment)
GrumPHP\Console\Command\Git\InitCommand:
class: \Space48\CodeQuality\Command\InitCommand
arguments:
- '@GrumPHP\Configuration\Model\HooksConfig'
- '@grumphp.util.filesystem'
- '@process_builder'
- '@GrumPHP\Util\Paths'
tags:
- { name: 'console.command' }
GrumPHP\Locator\RegisteredFiles:
class: \Space48\CodeQuality\Locator\RegisteredFiles
arguments:
- '@GrumPHP\Git\GitRepository'
- '@GrumPHP\Util\Paths'
- '@GrumPHP\Locator\ListedFiles'
## add '--fix' cli option
GrumPHP\Console\Command\RunCommand:
class: \Space48\CodeQuality\Command\RunCommand
arguments:
- '@GrumPHP\Collection\TestSuiteCollection'
- '@GrumPHP\Locator\StdInFiles'
- '@GrumPHP\Locator\RegisteredFiles'
- '@GrumPHP\Runner\TaskRunner'
tags:
- { name: 'console.command' }
GrumPHP\Configuration\Model\FixerConfig:
class: \Space48\CodeQuality\Configuration\FixerConfig
factory: [ '\Space48\CodeQuality\Configuration\FixerConfig', 'fromArray' ]
arguments:
- '%fixer%'
## linter settings
grumphp:
git_hook_variables:
## (remove on non warden environment)
EXEC_GRUMPHP_COMMAND: 'warden env run --rm php-fpm'
ignore_unstaged_changes: false
fixer:
enabled: true
fix_by_default: false
tasks:
phpmd:
whitelist_patterns:
- /^app/
triggered_by: [ 'php', 'phtml' ]
exclude: [ ]
report_format: xml
ruleset: [ 'phpmd.xml' ]
phpcs:
standard: [ 'ruleset.xml' ]
severity: ~
error_severity: ~
warning_severity: ~
tab_width: ~
report: full
report_width: ~
whitelist_patterns:
- /^app/
triggered_by: [ 'php', 'phtml' ]
encoding: ~
ignore_patterns: [ ]
sniffs: [ ]
exclude: [ ]
eslint:
bin: node_modules/.bin/eslint
triggered_by: [ js, jsx, ts, tsx, vue ]
whitelist_patterns: [ /^app/ ]
config: .eslintrc
debug: false
format: ~
max_warnings: ~
no_eslintrc: false
quiet: false
stylelint:
bin: node_modules/.bin/stylelint
triggered_by: [ css, scss, less ]
allowed_paths:
- /^app/
extensions:
- Space48\GrumPHPStylelintTask\Extension