Giter Site home page Giter Site logo

github-todos's People

Contributors

aleku399 avatar epicallan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

github-todos's Issues

API Function for adding an issue with comments to a repo

Say you have a set of issues of below type

type Body = string;
type Title = string;

interface Issue { 
   title:  title;
   body: Body;
};

write a function that can add a list of issues to a repository. Write in file lib/github/addIssueToRepo.ts

Transform Todo issue objects into issue with comments

transform a list of RepoIssues[] i.e

interface RepoIssues {
   commentText: string;
   lineNumber: number;
   keyWord: KeyWord;
   fileName: string;
}

Into an issue with title named: <keyword> issues from source code and with extracted code issues as comments. For keyword TODO, title would be; TODO issues from source code

The comment item could have text of the form:

<fileName> : <lineNumber> <commentText>

So your function will return a list of issue of the form:

type Comment = string;
type Title = string;
interface IssueWithComments { 
   title:  Title
   comments: Comment[]
};

Write this in lib/github/issue-presenter.ts

Github todos badge.

Build a simple API that can create a git hub badge.

Below are badge examples;

screen shot 2018-10-09 at 3 26 53 pm

Turn issueWithComments into an issue with title and body.

Given a list of issuesWithComments of type

Array<{
   title:  Title
   comments: Comment[]
}>

Turn them into a list of issues with body from comments and title. i.e

type Body = string;
type Title = string;

interface Issue { 
   title:  title;
   body: Body;
};

create body as a string created by joining the comments list with a new line deliminator (separator), where each comment item has already been transformed into a checklist item as below

const formattedComment  = `- [ ] ${commentText}`

Do this in the issuePresenters module

support config file

A config file may be added to a repo that a bot has access to. This config file can then be used to change bot behavior.

Possible config values may include;

  • keywords to listen for i.e TODO, FIXME, BUG
  • boolean flag for auto-deleting checked out or no longer existing TODO items in source code
  • issue labels to add to auto created bots
  • mode in which bot should run i.e add issues on PR or on pushing to a specific branch (default master) see #65
  • files to ignore (regex pattern)
  • root directories of the project such that it is easy to traverse project for comments on bot install see #54 defaults can be src, app etc

Issues management

Once a TODO / FIXME comment has been removed from a source code file, we would like to delete it from the auto-created Github TODO issue comments.

Preferable approach:

  • Get all current issue comments on GitHub. #69
  • Cross check whether returned Github issues ( done in #69 ) still exist in the source code. Return a list of those that should be kept or removed. (#72 )
  • Delete no longer existing issue comments (done in #72) from Github. (#57 )
  • Remove an assignee from bot created issue once the issue no longer exists or has been checked #59

add assignees to bot created issues text

assignee (user who created comment) should be added to issue comment text as below

- [ ] [src/lib/github/repoIssuesList.ts](https://github.com/freelyformd/github-todos/blob/master/src/lib/github/repoIssuesList.ts#L20) : todo comment text  by @epicallan 

Improve error handling

We should have error types for various Async errors and handle them from one place. This may involve possibly creating a file called errors.

Remove nolonger existing issue comments in source-code from github Issue

We need to remove comments on GH-TODO bot issue on Github that no longer exist in the source code.
Some code is going to be written to create a list of the issue comments to delete or edit in other issues that are subtasks of #71.

So, for this issue expect a list of comments to delete or edit (overwrite) using GitHub issue comments API.

Assume usage of types below;


type CommentEditAction = "delet | "edit"; // can be enum 

const delete:  CommentEditAction = "delete"
const edit :  CommentEditAction = "edit"

interface CommentEdit { 
  GhIssueId: number;
  GhCommentId: number;
  action:  CommentEditAction;
  commentsText: string[];
}

// the list of items to remove or edit is a list of this type, done in other issues.
type CommentsEdit = CommentEdit[] 

For instance, if a comment on a GitHub TODO issue with two items has one item removed from source code, we will over-write that comment to have only one instead of previous two.

If a comment on GitHub TODO issue has two items and they both get removed from source code, we would need to delete that comment instead of overwriting it.

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.