Giter Site home page Giter Site logo

stodo's Introduction

stodo

Cli & package to list all your todos in a project

JSR

Requirements

You need to have the following installed on your system

Usage

You can use the cli to search for all todos in a directory. The following command will search for all todos in the current directory. It will also use git blame to find the author of the todo and jq to filter the output. The command will exit with a non-zero code if there are todos found with a priority greater than 5.

deno run --allow-run=rg,git,jq jsr:@michaelmass/stodo/cli search --git-blame --exit-code --jq ".[] | select(.priority > 5)"

You can also use the package to search for all todos in a directory

import { search } from 'https://deno.land/x/stodo/mod.ts'

const todos = await search({
  tags: ['todo', 'fixme', 'fix', 'bug', 'mark'],
  comments: ['//', '#'],
  globs: ['!.git/*'],
  dir: 'path/to/dir',
  priorities: [
    {
      name: 'urgent',
      marker: '!!',
      value: 10,
    },
    {
      name: 'high',
      marker: '!',
      value: 8,
    },
    {
      name: 'medium',
      marker: '?',
      value: 5,
    },
    {
      name: 'low',
      marker: '',
      value: 0,
    },
  ],
  gitBlame: true
})

console.log(todos)

Docker is also supported

docker run -it -v path/to/folder:/src michaelmass/stodo search --format pretty -d /src

Options

  • tags: Array of tags to search for
  • comments: Array of comment types to search for
  • globs: Array of globs to ignore or include
  • dir: Directory to search in
  • priorities: Array of priorities to add to todos
    • name: Name of the priority
    • marker: Marker to search for
    • value: Priority value (> 10 is high, < 5 is low, else medium)
  • gitBlame: Boolean to enable git blame
  • jq: Filter the output with jq
  • exitCode: Exit with a non-zero code if there are todos found (combined with jq to filter for priority)

License

MIT

stodo's People

Contributors

michaelmass avatar

Watchers

 avatar

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.