All Projects → lewislbr → ready

lewislbr / ready

Licence: MIT license
A program to run tasks before a commit.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to ready

blackbricks
Black for Databricks notebooks
Stars: ✭ 40 (+150%)
Mutual labels:  pre-commit, pre-commit-hook
conventional-pre-commit
A pre-commit hook that checks commit messages for Conventional Commits formatting
Stars: ✭ 66 (+312.5%)
Mutual labels:  pre-commit, pre-commit-hook
pre-commit-dbt
🎣 List of `pre-commit` hooks to ensure the quality of your `dbt` projects.
Stars: ✭ 149 (+831.25%)
Mutual labels:  pre-commit, pre-commit-hook
pre-commit-mirror-maker
Scripts for creating mirror repositories that do not have .pre-commit-hooks.yaml
Stars: ✭ 19 (+18.75%)
Mutual labels:  pre-commit
pre-commit-opa
Pre-commit git hooks for Open Policy Agent (OPA) and Rego development
Stars: ✭ 53 (+231.25%)
Mutual labels:  pre-commit
NextCommunity.github.io
Join FREE: Community of open-source programmers and software engineers.
Stars: ✭ 29 (+81.25%)
Mutual labels:  pre-commit
Pre Commit
A framework for managing and maintaining multi-language pre-commit hooks.
Stars: ✭ 7,024 (+43800%)
Mutual labels:  pre-commit
pre-commit-hooks-safety
A pre-commit hook to check your Python dependencies against safety-db
Stars: ✭ 69 (+331.25%)
Mutual labels:  pre-commit
mdformat
CommonMark compliant Markdown formatter
Stars: ✭ 90 (+462.5%)
Mutual labels:  pre-commit
template-python
Template repository for Python projects
Stars: ✭ 20 (+25%)
Mutual labels:  pre-commit
slackbridge
Bridge between IRC and Slack running on Kubernetes
Stars: ✭ 12 (-25%)
Mutual labels:  pre-commit
check-jsonschema
A CLI and set of pre-commit hooks for jsonschema validation with built-in support for GitHub Workflows, Renovate, Azure Pipelines, and more!
Stars: ✭ 51 (+218.75%)
Mutual labels:  pre-commit
detect-secrets
A developer-friendly secrets detection tool for CI and pre-commit hooks based on Yelp's detect-secrets
Stars: ✭ 43 (+168.75%)
Mutual labels:  pre-commit
ocflib
Python libraries for account and server management
Stars: ✭ 13 (-18.75%)
Mutual labels:  pre-commit
create-react-redux-app
React boilerplate based on create-react-app
Stars: ✭ 49 (+206.25%)
Mutual labels:  pre-commit
pre-commit
pre-commit hook terraform; pre-commit hook prometheus
Stars: ✭ 35 (+118.75%)
Mutual labels:  pre-commit
hulks
Olist custom linting hooks 💚 👽
Stars: ✭ 25 (+56.25%)
Mutual labels:  pre-commit
pre-commit-hooks
git pre-commit hooks
Stars: ✭ 71 (+343.75%)
Mutual labels:  pre-commit
Pre Commit Hooks
Some out-of-the-box hooks for pre-commit
Stars: ✭ 2,605 (+16181.25%)
Mutual labels:  pre-commit
Husky
Git hooks made easy 🐶 woof!
Stars: ✭ 25,056 (+156500%)
Mutual labels:  pre-commit

Ready

Ready is a program to run tasks before a commit using a pre-commit git hook.

For example, you can automatically run formatting, linting, and testing when running git commit, so you are assured every commit is up to the standards, issues are spotted early, and to avoid any CI pipeline failures down the road.

Tasks are run on the repository folder that contains files with changes, including the root. Monorepos are supported by using the directory option on the configuration file, where tasks will be run only on subfolders with changes.

At any time, tasks can be run without committing by running ready. By default, if there are no changed files, no tasks will be run, but you can use ready -all to run all tasks even when no changes exist.

Additionally, to commit without running any task, the -n/--no-verify git commit flag can be used.

Instructions

  1. Install Ready

You can use Go:

go install github.com/lewislbr/ready@latest

Or download the binary from the releases page and place it in your $PATH.

  1. Install hook

Must be run in the repository root path (where the folder .git is located).

ready init

This will check for any existing pre-commit hook, and if found, it will prompt to override it or abort the process. If no hook is found, a new one with execution rights will be created.

  1. Create tasks file

File must be named ready.yaml and placed in the repository root path (where the folder .git is located).

tasks:
  - name: format
    command: gofumpt -l -w .
  - name: lint
    command: golangci-lint run

By default, commands will be run in the root directory, but they can be scoped to nested directories with the directory option:

tasks:
  - name: format
    command: gofumpt -l -w . # This will run in the root directory (./)
  - name: lint
    directory: app-1
    command: golangci-lint run # This will run in the app-1 directory (./app-1)
  - name: lint
    directory: app-2
    command: golangci-lint run # This will run in the app-2 directory (./app-2)

YAML file reference

tasks: # Array of tasks to be run (required)
  - name: format # Name of the task (required)
    directory: app-1 # Directory where to run the command (optional)
    command: gofumpt -l -w . # Command to run (required)

Example

example-fail

example-success

Contributing

This project started as a way to learn and to solve a need I had. If you think it can be improved in any way, you are very welcome to contribute!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].