PHP code example of dev-kraken / php-commitlint

1. Go to this page and download the library: Download dev-kraken/php-commitlint library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dev-kraken / php-commitlint example snippets

bash
vendor/bin/php-commitlint install
bash
vendor/bin/php-commitlint install [options]
bash
vendor/bin/php-commitlint uninstall [--force]
bash
# Works in PowerShell, Command Prompt, or Git Bash
composer p-commitlint install   # Git Bash
yaml
stages:
  - test
  - validate

test:
  stage: test
  image: php:8.3
  before_script:
    - apt-get update && apt-get install -y git unzip
    - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
    - composer install
  script:
    - composer test
    - composer analyse

validate-commits:
  stage: validate
  image: php:8.3
  script:
    - composer install
    - vendor/bin/php-commitlint validate "$CI_COMMIT_MESSAGE"