B4U is a configurable multithreaded task runner designed to integrate into any git project. It allows you to implement your own quality checks before git actions (commits, pushes, etc.).
B4U is intended to be fast, configurable and (importantly) not annoying.
- Install:
gem install B4U
- Initialize:
B4U --init
- Configure tasks in
.B4U/commit.yml
and.B4U/push.yml
- Commit these files to your version control
- Team setup:
B4U --enable
(after cloning)
Install the gem:
gem install B4U
Or add to your Gemfile:
bundle add B4U
B4U uses YAML configuration files in the .B4U
directory:
.B4U/commit.yml
- Tasks to run before commits.B4U/push.yml
- Tasks to run before pushes
Each task requires a name
and command
. Optionally add ignore: true
for non-blocking tasks:
linters:
- name: "Unit tests"
command: "bundle exec rspec"
ignore: true # Won't block commit if this fails
- name: "Rubocop"
command: "bundle exec rubocop"
- name: "ESLint"
command: "npm run lint"
- name: "Type checking"
command: "npm run type-check"
Important: Tasks run in parallel, so only use read-only commands to avoid conflicts.
B4U --help # Show help
B4U --version # Show version
B4U --init # Initialize B4U in current project
B4U --enable # Enable B4U hooks in current project
B4U --commit # Run pre-commit tasks
B4U --push # Run pre-push tasks
Running B4U --init
will:
- Create a
.B4U
directory with configuration files. - Set up git hooks for pre-commit and pre-push events.
Running B4U --enable
will:
- Set up your local git hooks for pre-commit and pre-push events.
Important: Anyone who clones the project needs to run B4U --enable
to activate the hooks locally so should add this to your setup script and/or README.md.
"Command not found: B4U"
-
If you're seeing this error and you already have installed B4U, it is likely caused by your IDE or version manager.
B4U runs by calling itself from the shell scripts in the
.B4U
folder, so you can add any logic needed to point to the correct version of Ruby or even install the gem to the current version.
Bug reports and pull requests are welcome on GitHub. This project is intended to be a safe, welcoming space for collaboration.
- Fork the repository.
- Create your feature branch (
git checkout -b feature/amazing-feature
). - Commit your changes (
git commit -am 'Add amazing feature'
). - Push to the branch (
git push origin feature/amazing-feature
). - Open a Pull Request.
Please make sure to update tests as appropriate and adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the B4U project's codebases, issue trackers, and discussions is expected to follow the code of conduct.