Comment on problems in added lines of pull requests in Atlassian Bitbucket Server (formerly Stash)
Ruby
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
exe
lib
test
.gitignore
.rubocop.yml
.vexor.yml
CODE_OF_CONDUCT.md
Gemfile
LICENSE
README.md
Rakefile
TODO
USAGE
face_control.gemspec

README.md

Gem Version Code Climate Vexor Coveralls VersionEye

Face Control

Run static analysis of pull requests in Bitbucket Server (formerly Stash) and comment on problems in added lines.

Currently supports RuboCop and CoffeeLint and also checks for TODOs and FIXMEs.

Inspired by Hound.

Installation

gem install face_control

You also need to have CoffeeLint installed and available in PATH.

Usage

face-control <project> <repository> <pull_request_id>

It's natural to run this on a continuous integration server. For example, here's a Jenkins project setup:

  • Source Code Management

    • Git
      • Repositories

        • Refspec:

            +refs/pull-requests/*:refs/remotes/origin/pull-requests/*
          

          (make Jenkins fetch otherwise ignored Stash-created branches)

      • Branches to build

        • Branch Specifier:

            origin/pull-requests/*/merge
          

          (merge results of open non-conflicting pull requests)

  • Build

    • Execute shell
      • Command

          export PULL_REQUEST_ID=`echo $GIT_BRANCH | cut -d / -f 3`
        
          gem install rubocop face_control
          npm install -g coffeelint
        
          face-control <project> <repository> $PULL_REQUEST_ID
        

If you don't want to receive RuboCop comments with certain severity level, pass the severity in the --skip-severity option like so:

face-control --skip-severity convention <project> <repository> <pull_request_id>

You can use just -S. You can also pass multiple severity levels as a comma-separated list:

face-control -S convention,refactor <project> <repository> <pull_request_id>

face-control uses the same configuration file (~/.stashconfig.yml) as the official Bitbucket Server Command Line Tools to connect to your Stash instance.

Etymology

Face control in Wikipedia