Skip to content

Instantly share code, notes, and snippets.

@mautz-et-tong
Created August 10, 2021 19:14
Show Gist options
  • Save mautz-et-tong/b1fb6a28f3bcc12d441d83ecd97e7b9a to your computer and use it in GitHub Desktop.
Save mautz-et-tong/b1fb6a28f3bcc12d441d83ecd97e7b9a to your computer and use it in GitHub Desktop.
grumphp:
environment:
variables:
GRUMPHP_PROJECT_DIR: "."
GRUMPHP_BIN_DIR: "./www/html/vendor/bin"
GRUMPHP_COMPOSER_DIR: "./www/html"
paths:
- 'tools'
hide_circumvention_tip: true
process_timeout: 120
stop_on_failure: false
ignore_unstaged_changes: false
tasks:
# First everything which lints, secures or verifies something
jsonlint:
detect_key_conflicts: true
metadata:
priority: 100
xmllint:
ignore_patterns:
- "#test/(.*).xml#"
metadata:
priority: 100
yamllint:
ignore_patterns:
- "#test/(.*).yml#"
- "#charts/.*#"
metadata:
priority: 100
# filter not allowed keywords
git_blacklist:
keywords:
- "\\.dev$"
- "\\.local$"
- "\\.test$"
- "<<<<<<<"
- "======="
- "DebuggerUtility"
- "ObjectManager::getInstance"
- "_GET\\["
- "_POST\\["
- "_REQUEST\\["
- "console.log\\("
- "die\\("
- "die;"
- "exit\\("
- "exit;"
- "fileadmin"
- "localhost"
- "phpinfo"
- "phpinfo\\("
- "print_r\\("
- "var_dump\\("
triggered_by: [php, js, html]
metadata:
priority: 90
regexp_type: E
# validate composer json
composer:
file: "./www/html/composer.json"
no_check_all: false
no_check_lock: false
no_check_publish: false
with_dependencies: true
strict: true
metadata:
priority: 80
# validate git branch names
git_branch_name:
whitelist:
- "/(hotfix|bugfix|feature)\\/([0-9]+)$/"
blacklist:
- "release"
- "develop"
- "main"
- "infra"
allow_detached_head: true
# validate git commit message
# [<TYPE>] #<issue_nuber>: <subject> (Max 100 char)
git_commit_message:
allow_empty_message: false
enforce_capitalized_subject: false
enforce_no_subject_punctuations: false
enforce_no_subject_trailing_period: true
type_scope_conventions: []
max_body_width: 100
max_subject_width: 100
matchers:
"Commit message must contain issue number": /(#\d+|RELEASE):\s.*/
"Commit message must contain issue type": /^\[(HOTFIX|BUGFIX|FEATURE|INFRA|MERGE|RELEASE)]\s.*/
case_insensitive: true
multiline: false
additional_modifiers: ''
# run PHP_CodeSniffer
phpcs:
standard: "Magento2"
whitelist_patterns:
- /^www\/html\/app\/code\/(AGENCY|CUSTOMER)\/(.*)/
ignore_patterns:
- /^www\/html\/vendor\/(.*)/
tab_width: 4
metadata:
priority: 70
triggered_by: ['php' , 'phtml']
report: summary
phpcsfixer2:
config: "./www/html/.php-cs-fixer.php"
using_cache: false
cache_file: "./www/html/php_cs.cache"
config_contains_finder: true
allow_risky: false
verbose: true
phpcpd:
directory:
- "www/html/app/code/AGENCY"
- "www/html/app/code/CUSTOMER"
exclude: ['Magento','LEGACY_VENDOR','VENDOR', '*Test.php', 'vendor']
fuzzy: true
min_lines: 25
min_tokens: 100
triggered_by: [ 'php', 'phtml' ]
phpstan:
autoload_file: './www/html/vendor/bitexpert/phpstan-magento/autoload.php'
configuration: './www/html/phpstan.neon'
triggered_by: [ 'php', 'phtml' ]
memory_limit: "-1"
use_grumphp_paths: true
metadata:
priority: 70
#run PHP Mess Detector
phpmd:
ruleset: [ "www/html/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml" ]
exclude:
- "www/html/app/code/Magento/"
- "www/html/app/code/LEGACY_VENDOR/"
- "www/html/app/code/*/*/Setup/"
- "www/html/vendor/"
- "www/html/scripts/"
metadata:
priority: 70
phplint:
exclude: [ 'vendor' ]
short_open_tag: false
ignore_patterns: [ ]
triggered_by: [ 'php', 'phtml' ]
npm_script:
script: build-dev
triggered_by: [ css ]
working_directory: "./www/html/app/design/frontend/CUSTOMER/DESIGN/web/tailwind"
is_run_task: true
silent: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment