Skip to content

GordyD/prettier-master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

A bot that runs Prettier on all JavaScript code that has been changed in the last commit.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published