Coder Social home page Coder Social logo

pr's Introduction

pr (name tbd) helps you quickly create ✨high context✨ pull requests from the command line.

v0 gif

Current features

Run a single command to automatically infer a bunch of useful information to be included in a PR, then automagically open it up on GitHub -- all without having to leave your terminal.

  • Accepts target branch for PR as argument or automatically chooses main / master according to how current repository is configured
  • Parses current branch name for "DIT-XXX" pattern; if matched, use pattern to query Linear ticket information from Linear API
  • If Linear ticket is found:
    • Auto-populates PR title following pattern "[DIT-XXX] {Linear ticket name}"
    • Auto-populates Context section of PR body with Linear ticket description
  • Auto-populates Overview section of PR body with chronologically ordered commits that exist in current branch but don't exist in the target branch
  • In the style of git commit:
    • Opens generated PR title in default system $EDITOR (e.g. vim) forediting before submitting
    • Opens generated PR body in default system $EDITOR (e.g. vim) for editing before submitting

Requirements

  • git installed
  • gh installed and authenticated

Installation

lol homebrew or somethin?

if you want to use this right now you'll install the Rust toolchain stuff, clone the repo, run cargo build, then symlink the binary somewhere in your $PATH - sounds like a nightmare.

WIP:

(will eventually look like this but not currently supported)

curl -LO https://raw.githubusercontent.com/azjgard/pr/main/bin/install.sh && sudo chmod +x ./install.sh && sudo ./install.sh && rm ./install.sh

Usage

Current working directory must..

  • be a git repo
  • have a remote called origin
  • have an .env file in with LINEAR_API_KEY specified in it:
LINEAR_API_KEY=lin_api_xxxxx

Then it's ez!

# automatically open PR for current branch
pr

# automatically open PR for explicit target
pr some/target/branch

Development

To create a new release, simply run ./bin/release.sh and follow the prompts.

TODOS

  • Help menu
  • Support selecting list of recent screenshots (+gifs?) in screenshot directory to include in PR body
    • Upload as attachments to Linear ticket, Jira ticket or some other custom specified source, and then use the links generated from there to include in PR markup.
  • Support for parsing project management ticket identifier patterns from commit messages to associate multiple tickets with a single PR.
  • Support reading from a configuration file:
    • PR title template
    • PR body template
    • Default target branch for PRs
    • Settings for project management integration (Linear versus Jira versus etc)
    • Regex for parsing project management ticket identifier
  • Tests
  • Refactor all my garbo code
  • Multithread or something? idk

Motivation

Two reasons for creating this:

  1. It's a tool I've been craving because I spend an excessive amount of time writing PR descriptions and creating a network of backlinks between GitHub, Linear, and Slack to make things easier to refer to later.
  2. I wanted a simple starter project to learn Rust with -- everyone is talking about it and I got FOMO.

pr's People

Contributors

jaerod95 avatar azjgard avatar asnewman avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jaerod95 asnewman

pr's Issues

Failed to create PR! Warning: 1 uncommitted change

image

When I have an uncommitted change, I get the error Failed to create PR! even though the PR does get created. I think the error should be removed (creating a PR while having uncommitted changed seems fine to me). Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.