0.0
Low commit activity in last 3 years
No release in over a year
a small CLI that lints your code and run your tests before you push
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.16
~> 0.9.5
~> 0.12
~> 10.0
~> 3.0
~> 0.60
~> 0.16.1

Runtime

~> 0.8.1
~> 1.6.0
 Project Readme

Build Status Maintainability Test Coverage

SafePusher

Run your favorite linters and specs on the files you touched, before committing and pushing your branch.

Installation

Add these lines to your application's Gemfile:

# Lint and launch specs before pushing.
gem 'safe_pusher', require: false

And then execute:

$ bundle

Or install it yourself as:

$ gem install safe_pusher

To use the gem fully, you should install pronto and rspec first.

Configuration

Generate the binstubs for pronto, rspec and safepush:

$ bundler binstubs pronto rspec-core safe_pusher

Create the safe_pusher.yml file at the root of your application:

files_to_skip:
  - file/to/skip_1
  - file/to/skip/2
base_branch: developement # default master
app_base_directory: app
repo_url: https://github.com/williampollet/safe_pusher
services:
  test: rspec
  lint: pronto
  push: github
  open: github
  add: git
  amend: git
  commit: git
verbose: true

Usage

To see the commands available, type:

$ safepush

To run pronto checks before you push to GitHub run:

$ safepush lint push open

or

$ safepush l p o

To run specs and pronto before you push to GitHub run:

$ safepush test lint push open

or

$ safepush t l p o

Available commands so far

  • test (runs the tests only on the files you touched)
  • lint (runs a linter only on the files you touched)
  • commit (commit your changes)
  • add (track your changes)
  • amend (amend your tracked changes to your last commit)
  • push (push and set upstream your local branch on github)
  • open (open a pull request on github)

Contributing

You can easily add a new client, or a new command.

To add a client

  • create the client api under lib/safe_pusher/client/***.rb
  • require it in lib/safe_pusher.rb
  • write the specs for your client, then submit a PR
  • You will be able to specify in which command to use it, via the configuration !

To add a command

  • configure your command and its client in config/commands.yml
  • create your safepusher client api, as detailed above (if necessary)
  • include your command's description in the help, in config/en.yml

Guidelines

Bug reports and pull requests are welcome on GitHub at https://github.com/williampollet/safe_pusher. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Development

Setup development:

$ bin/setup

Open a console:

$ bin/console

Test the CLI:

$ ruby -Ilib exe/safepush

Launch specs and lint:

$ rake

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the SafePusher project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.