Giter Site home page Giter Site logo

kunal-sin / drupal-quality-checker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from innoraft/drupal-quality-checker

0.0 0.0 0.0 13 KB

Code quality checker for Drupal based projects.

Home Page: https://packagist.org/packages/innoraft/drupal-quality-checker

drupal-quality-checker's Introduction

Drupal Code Quality Checker


Overview

This composer package will provide some basic code quality checks before committing code by using https://github.com/phpro/grumphp. Check out this Lullabot article for more details.

This has been customised from vijaycs85/drupal-quality-checker for Innoraft needs.

Install

  1. Add innoraft/drupal-quality-checker to composer.json or just composer require --dev innoraft/drupal-quality-checker
  2. Replace grumphp.yml in project's root directory (not Drupal root directory) with vendor/innoraft/drupal-quality-checker/grumphp.yml.dist

That's it. Now, all tasks (listed below) run on every git commit.

Note: As part of install, GrumPHP adds pre-commit hook to repository. Existing pre-commit might get destroyed when install/uninstall.

Out of the box

  1. PHPCS with Drupal standard.
  2. PHP Lint
  3. YAML Lint
  4. Composer
  5. Composer Normalize
  6. JSONLint
  7. PHP Copy/Paste Detector (CPD)

Long list of additional checks/validators available here.

ESLint task Setup

  1. Go to custom theme folder and add eslint package with npm
npm install eslint --save-dev
npm install eslint-config-airbnb --save-dev
  1. Now run this command at project's root directory
cp vendor/innoraft/drupal-quality-checker/eslintrc.json.dist .eslintrc.json
  1. Update bin key for eslint task under grumphp.yml file with relative address to eslint's bin file.

Stylelint task Setup

  1. Go to custom theme folder and add stylelint package with npm
npm install stylelint --save-dev
  1. Now run this command at project's root directory
cp vendor/innoraft/drupal-quality-checker/stylelintrc.json.dist .stylelintrc.json
  1. Update bin key for eslint task under grumphp.yml file with relative address to eslint's bin file.

drupal-quality-checker's People

Contributors

hemuvyas avatar kunal-sin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.