Giter Club home page Giter Club logo

krypto's Introduction

Krypto

tests black Code style: black Coverage Status

A neat little sidekick python script to create issues on your repo based on comments left in the code on your behalf

Convert todo comments in your code
# TODO[Enhancement]: Make config file
# Sometimes you might wanna have TODOs in your tests.
# Right now krypto will completely ignore any file with the
# substring "test" in the path. I would want to be able to
# configure this behaviour. Perhaps read from pyproject.toml?`

to GitHub issues on the repository you're working on!

Sample issue on Github


Env Variables

For this to work you need to have a github token in your environment variables. To acquire a token navigate to Developer Settings and generate one.

With the token in hand, simply,

export KRYPTO_TOKEN = <token_here>

or

$env:KRYPTO_TOKEN = token_here

If you want the token to persist across sessions you need to add it to your .bashrc or $PROFILE.

Usage


Write a TODO

First, create a TODO in the form of a block comment. The TODO must contain a title. Body and labels are optional.

Examples:

  • Title only, no body or labels

    # TODO: This is a title
  • Title, body, no labels

    # TODO: This is a title
    # This is in the TODO body
  • Title, body and labels

    # TODO[Enhancement]: This is a title
    # This is in the TODO body
  • Multiple labels

    # TODO[Enhancement, Bug, Documentation]: This is a title

Valid separators include , / # ~ \

To run

Pass the directory to look in for TODOs.

krypto run <path-to-dir>

To perform the collection and parsing of TODOs but not the HTTP request to github, pass the --dry flag to the run command.

krypto run <path-to-dir> --dry

Krypto does not look in tests/ at the moment.


GitHub Action

This action runs Krypto on your code and creates issues on the repo on your behalf.

Inputs

dir

Required The path to the directory to scan for TODOs.

Env

KRYPTO_TOKEN

Required A personal access token for github to use to authenticate the creation of issues on your repository.

Example usage

uses: antoniouaa/krypto@v2
with:
    dir: "."
env:
    KRYPTO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Run krypto on the root of the project


Inspired by tsoding/snitch

krypto's People

Contributors

antoniouaa avatar erikoui avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

krypto's Issues

Allow specifying branch name

When krypto creates an issue and attaches a link to the todo locally, it only considers todos in the master branch. It would be nice to be able to either specify which branch you're on or have krypto automatically figure it out and adjust links.

Line: 19 in krypto/__init__.py

Possible creation of pre-push git hook

Think about making this into a git script to hook into the pre-push action instead of having to run the script manually Lets try to test this right now. Considering making a github action instead of a messy post-push hook

Line: 1 in krypto\__main__.py

Issues are reopened if they're closed through the website

ATM if a user closes an open issue through the Github GUI but does not remove the TODO from the code and reruns krypto, krypto opens a new issue with the same title and body. Krypto should check if an issue with the same title or number exists on github, whether it is closed or still open and decide whether to post or not.

Line: 35 in krypto\github.py

Make config file

Sometimes you might wanna have TODOs in your tests. Right now krypto will completely ignore any file with the test substring in the title. I want to be able to configure this behaviour. Perhaps read from pyproject.toml?

Line: 12 in krypto/__init__.py

Refactor make_requests

It doesnt make sense that a github related function handles attaching links to TODOs in the code locally This should be moved to the krypto.todo file instead

Line: 132 in krypto/github.py

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.