0.0
No release in over a year
Danger plugin for PHPMD.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 2.14
= 3.0.7
>= 0
~> 13.0
~> 3.4
>= 0

Runtime

 Project Readme

danger-phpmd

Danger plugin for phpmd.

Installation

$ gem install danger-phpmd

phpmd also needs to be installed before you run Danger. Please check the installation guide.

Usage

Add this to Dangerfile.

phpmd.run ruleset: "rulesets.xml"

If you want to specify phpmd bin file, you can set a bin path to the binary_path parameter.

phpmd.binary_path = "vendor/bin/phpmd"
phpmd.run ruleset: "rulesets.xml"

GitHub actions

name: CI

on: [pull_request]

jobs:
  danger:
    runs-on: ubuntu-latest
    if: github.event_name  == 'pull_request'
    steps:
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.6
        bundler-cache: true

    - name: Setup PHP environment
      uses: shivammathur/setup-php@v2
      with:
        php-version: '8.0'
        coverage: none
        tools: phpmd

    - run: bundle exec danger
      env:
        DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}