Giter VIP home page Giter VIP logo

dart's Introduction

Danger.dart

Supports GitHub and Bitbucket Cloud.

Still under development

Using Danger Dart

  • Install Danger JS
$ npm install -g danger
  • Adding danger_core to dev_dependencies
dev_dependencies:
  danger_core:
  • Create dangerfile.dart
// @dart=2.10
import 'package:danger_core/danger_core.dart';

void main() {
  if (danger.github.pr.title.contains('WIP')) {
    warn('PR is considered WIP');
  }
}

Notes

For GithubAction, you need to set GITHUB_TOKEN as environment example

- name: Run danger ci
  run: danger_dart ci
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Commands

  • danger_dart ci - Use this on CI
  • danger_dart pr https://github.com/Moya/Harvey/pull/23 - Use this to build your Dangerfile
  • danger_dart local - Use this to run danger against your local changes from master

Debugging dangerfile.dart

Check the Debugging doc.

Development

We can use pub global activate to enable command danger_dart.

$ pub global activate --source path packages/danger_dart/

Or using dart to run directly.

$ dart packages/danger_dart/bin/danger_dart.dart ci
$ dart packages/danger_dart/bin/danger_dart.dart pr https://github.com/Moya/Harvey/pull/23
$ dart packages/danger_dart/bin/danger_dart.dart local

Plugins

You can create your own plugin using command

$ dart create -t package-simple <plugin_name>

In pubspec.yaml put danger_core in dependences

dependencies:
  danger_core:

For more information, see the example https://github.com/danger/dart/tree/master/packages/danger_plugin_dart_test

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.