Skip to content

Instantly share code, notes, and snippets.

@jorenvh
Created December 9, 2023 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorenvh/3568bbb3f535b0cc0e985e71d4ad827e to your computer and use it in GitHub Desktop.
Save jorenvh/3568bbb3f535b0cc0e985e71d4ad827e to your computer and use it in GitHub Desktop.
GrumPHP config example
parameters:
grumphp.ignore_patterns:
- '*/vendor'
- 'bin'
- 'custom/plugins'
- 'public'
- 'tests'
- 'var'
- 'src/Command'
grumphp:
stop_on_failure: false
fixer:
enabled: true
fix_by_default: true
environment:
variables:
PHP_CS_FIXER_IGNORE_ENV: "1"
tasks:
# Git
git_commit_message:
allow_empty_message: false
enforce_capitalized_subject: false
enforce_no_subject_trailing_period: true
enforce_single_lined_subject: false
additional_modifiers: ''
case_insensitive: true
multiline: true
max_subject_width: 120
max_body_width: 90
matchers:
- /^PROJ+|^Merge+|^Internal+|^Improvements+|^BUGFIX+|^HOTFIX+/
git_blacklist:
match_word: true
keywords:
- 'console.log('
- 'debug_backtrace('
- 'die('
- 'dd('
- 'dump '
- 'dump('
- 'empty('
- 'isset('
- 'exit;'
- 'var_dump('
- '__debug('
- 'is_null('
whitelist_patterns:
- /^public/(.*)
triggered_by: [php,js]
file_size:
max_size: 5M
metadata:
priority: 100
composer:
metadata:
priority: 100
# Linters
phplint:
metadata:
priority: 100
xmllint:
metadata:
priority: 100
yamllint:
parse_custom_tags: true
metadata:
priority: 100
# PHP
phpcsfixer:
config: '.php-cs-fixer.php'
allow_risky: true
cache_file: ~
using_cache: ~
config_contains_finder: true
verbose: true
diff: false
triggered_by: ['php']
metadata:
priority: 200
phpparser:
ignore_patterns: '%grumphp.ignore_patterns%'
visitors:
no_exit_statements: ~
never_use_else: ~
forbidden_function_calls:
blacklist:
- dd
- debug_backtrace
- die
- dump
- echo
- empty
- exit
- isset
- phpinfo
- print
- print_r
- var_dump
- is_null
metadata:
priority: 200
phpstan:
configuration: phpstan.neon
triggered_by: [ 'php' ]
metadata:
priority: 200
phpunit:
config_file: phpunit.xml.dist
always_execute: true
metadata:
priority: 200
clover_coverage:
clover_file: 'clover.xml'
level: 2
metadata:
priority: 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment