项目作者: hanneskaeufler

项目描述 :
A http://danger.systems/js plugin to level up with each pull request.
高级语言: TypeScript
项目地址: git://github.com/hanneskaeufler/danger-plugin-mentor.git
创建时间: 2018-01-28T17:34:32Z
项目社区:https://github.com/hanneskaeufler/danger-plugin-mentor

开源协议:MIT License

下载


danger-plugin-mentor

Build Status
npm version
semantic-release
Maintainability
Test Coverage

Level up your programming skills by getting bite-sized tips and tricks in your pull requests.

Usage

Install:

  1. yarn add danger-plugin-mentor --dev

At a glance:

  1. // dangerfile.js
  2. import mentor from 'danger-plugin-mentor'
  3. mentor()

example

You can specify an array of string tags to filter the shown tips:

  1. mentor(["testing", "agile"])

Should you not like or want to expand upon the default set of tips, you can pass an array of tips that you provide yourself.

  1. mentor([], myOwnListOfTips)

The items in myOwnListOfTips have to conform to the Tip interface, that,
in Typescript, you can import via import { Tip } from 'danger-plugin-mentor'.
In Javascript, you just need to make sure that every item responds to the methods
of this interface. Of course you can mix your own tips with the included tips:

  1. import { default as mentor, defaultTips } from 'danger-plugin-mentor'
  2. mentor([], [...defaultTips(), ...myOwnListOfTips])

In order to make it easy to provide your own list of tips, danger-plugin-mentor ships
with a fromJson that returns an array of lists from a json file.

  1. import { default as mentor, fromJson } from "danger-plugin-mentor"
  2. mentor([], fromJson(`
  3. [
  4. {
  5. "text": "My own tip",
  6. "source": "https://mycompany.com",
  7. "tags": ["awesome"]
  8. }
  9. ]
  10. `))

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.