Giter Site home page Giter Site logo

prettier-master's Introduction

prettier-master

Build Status

A bot that runs Prettier on all JavaScript code that has been changed. This will inspect the previous commit and run prettier against any updated JavaScript files. It will then commit the changes to master.

It has been written so that it can be easily used with Travis or Circle CI.

Installation

You'll need to install both prettier and prettier-master. The easiest set-up is to install them globally.

npm install -g prettier prettier-master

You can alternatively install them however you want, but then your usage will deviate from below. To use a different location of prettier you can use the environment variable PRETTIER_CMD to specify the relative path to the executable.

Environment variables

  • PRETTIER_CMD - default: 'prettier'
  • MASTER_BRANCH - default: 'master'
  • PR_ON_CHANGE - default: 'false' - if set to true, then when changes are made a PR will be opened instead of committing straight into the branch. This is the best setting to use.

Usage

You can use prettier-master locally but just running prettier-master within the directory of the repository you want to make prettier.

For better effect though this script has really been put together so that you can add it as part of CI process using either Travis or Circle.

Travis

Add to your install section:

  env:
    - PR_ON_CHANGE=true
  install:
    - npm install -g prettier prettier-master

Then add to your script section:

  script:
    - prettier-master

Push some JavaScript changes to your repo!

Circle

Documentation coming soon!

prettier-master's People

Contributors

gordyd avatar vjeux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.