Skip to content

martinnov92/todos-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todos creator

This package is for automatic creating of issues. Simply run create-todos and from your // TODO: has to be done! comment can be created issue on GitHub or GitLab, or you can provide your own methods for issue creation if you use another tracking provider.

There are two options how to set this up:

  • create issues automatically, or
  • create just a link with pre-filled title (labels will be added later) - this is default

Config

Use todos.spec.js config file, if you need more control. This file must be placed in root folder.

module.exports = {
    // is needed if you wish to create issues automatically, or your repository is private
    token: String,
    // is needed if you wish to create issues automatically (only for GitLab)
    projectId: String,
    // where to create issues (default: GitLab, GitHub)
    provider: String,
    // automatically create issue
    createIssue: Boolean,
    // Default: [ '.js' ]
    allowedExtensions: [String],
    // Default: [ 'node_modules', '.git' ]
    ignoreFolders: [String],
    // use only if you use other tracking system (default support: GitLab, GitHub)
    api: {
        // name should be same as 'provider' above
        [String]: {
            // check if issue already exists in your tracking system
            async check() {},
            createIssue () {},
            createIssueLink () {},
        },
    },
};

Example:

function example() {
    // TODO: Finish this function

    return;
}

Output example

/examples/example.js
Title | TODO: Create helper method
Existing issues
     ◉ https://github.com/user/repository/issues/1 (open)

/index.js
Title: TODO: Finish this function
Issue: https://github.com/user/repo/issues/new?title=Finish%20this%20function&labels=