phpro / grumphp

A PHP code-quality tool
MIT License
4.13k stars 430 forks source link

git_commit_message task is not triggered when multiple tasks are declared #892

Closed rshkembi closed 3 years ago

rshkembi commented 3 years ago
Q A
Version 1.3.1
Bug? yes
New feature? no
Question? no
Documentation? no
Related tickets comma-separated list of related tickets

My configuration

# grumphp.yml
# Please add a copy of your grumphp.yml file.
grumphp:
  hide_circumvention_tip: true
  process_timeout: 120
  tasks:
    composer:
      file: ./composer.json
      no_check_all: true
      no_check_lock: false
      no_check_publish: false
      with_dependencies: false
      strict: false
    git_blacklist:
      keywords:
        - "die("
        - "var_dump("
        - "print_r("
        - "exit;"
        - "console.log"
        - "_objectManager"
        - "ObjectManagerInterface"
        - "\\.dev"
        - "\\.local"
        - "\\.test"
        - "<<<<<<<"
        - "======="
        - "DebuggerUtility"
        - "ObjectManager::getInstance"
        - "_GET\\["
        - "_POST\\["
        - "_REQUEST\\["
        - "die;"
        - "exit("
        - "fileadmin"
        - "localhost"
        - "phpinfo"
    git_branch_name:
      whitelist:
        - "/([A-Z|a-z]+)-([0-9]+)(.*)$/"
      blacklist:
        - "main"
        - "develop"
        - "master"
    phpcs:
      standard: Magento2
      tab_width: 4
      severity: 10
      error_severity: 10
      warning_severity: ~
      report: full
      triggered_by: [phtml, php]
    phpcsfixer2:
      allow_risky: ~
      cache_file: ~
      config: '../.php_cs.dist'
      using_cache: ~
      verbose: true
      config_contains_finder: false
      triggered_by: ['php', 'phtml']
    git_commit_message:
      allow_empty_message: false
      enforce_capitalized_subject: false
      enforce_no_subject_punctuations: false
      enforce_no_subject_trailing_period: true
      enforce_single_lined_subject: true
      type_scope_conventions: [ ]
      max_body_width: 80
      max_subject_width: 80
      matchers:
        "Commit message must contain issue topic and number": "/([a-z|0-9]+)-([a-z|0-9]+)$/"
      case_insensitive: true
      multiline: false
      additional_modifiers: ''

Steps to reproduce:

1) Modify a file on git
2) Make a commit like this: `git commit -m "test"

Result:

# The git_commit_message task is not triggered

The grumphp config file has multiple tasks into it. If you leave only the git_commit_message task it will work but if you start adding tasks into it then it will fail

rshkembi commented 3 years ago

Ok so it looks like the commit message will run on a different set of tasks

image

is there any way we can combine all of them together?

veewee commented 3 years ago

No, the message is only available in the commit-msg git hook.