0.0
No commit activity in last 3 years
No release in over 3 years
CheckAhead let you define rules to guard against unwanted commits
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.15.0, < 3.0

Runtime

~> 0.4
 Project Readme

check-ahead badge

Helps you create consistent and transparent rules for checking commit messages.

Rake Tasks

check-ahead:commits - checks the commits against defined rules

check-ahead:generate_rules - generate rules from input

check-ahead uses your CONTRIBUTING.md file

### Commit Message
Accepted commits messages:
<commits>

* PA-\<digits>
* maint
* docs
</commits>

The accepted content is defined between <commits></commits> tag and <digits> will be translated to the correspunding regex: d+.

Check example CONTRIBUTING.md

This will be used by check-ahead:commits which allows only commit messages that match (PA-\d+|maint|docs)

Installation

Add this line to your application's Gemfile:

gem 'check-ahead'

And then execute:

$ bundle

Or install it yourself as:

$ gem install check-ahead

Usage

CLI

CLI - based on dry-cli
 - check-ahead --help # available commands
 - check-ahead command --help # help for specicif commands

Implemented commands:
 - check-ahead check_commits
 - check-ahead generate_rules TAGS

Tasks

# usually in your Rakefile

require 'check-ahead'
CheckAhead.load_tasks # loads rake task on demand

# alternative loading
require 'check-ahead'
include CheckAhead # loads rake task on project initialization

Configuration

The gem supports configuration for: commit_range, CONTRIBUTING.md path, base_tags

Example:

# inside your ruby project

CheckAhead.configure do |config|
  config.commit_range = 'master..HEAD'
  config.contributing_md = "/docs/CONTRIBUTING.md"
  config.base_tags = [revert]
  config.max_length = 100
  config.checking_max_length = true
end

or ENVIRONMENT variables:

ENV['BASE_TAGS']
ENV['CONTRIBUTING_MD']
ENV['COMMIT_RANGE']
ENV['MAX_LENGTH']
ENV['CHECK_MAX_LENGTH']

Defaults:

base_tags = %w[revert merge]
contributing_md = File.join('project_root/CONTRIBUTING.md')
commit_range = 'master..HEAD'
max_length = 50
check_max_length = false

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/gimmyxd/check-ahead. 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.

License

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

Code of Conduct

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