All Projects → tsoding → Snitch

tsoding / Snitch

Licence: mit
Language agnostic tool that collects TODOs in the source code and reports them as Issues

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Snitch

Mobile Toolkit
📱 Shell scripts for Android and iOS device management
Stars: ✭ 161 (+0%)
Mutual labels:  hacktoberfest
Vue Materialize Datatable
A fancy Materialize CSS datatable VueJS component.
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Spotify Github Profile
Show your Spotify playing on your Github profile
Stars: ✭ 159 (-1.24%)
Mutual labels:  hacktoberfest
Anitya
A cross-distribution upstream release monitoring project
Stars: ✭ 161 (+0%)
Mutual labels:  hacktoberfest
Glidex
glidex.forms is a library using Glide for faster Xamarin.Forms images on Android. Find out more about Glide at https://github.com/bumptech/glide
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Awesome Programming Presentations
Presentations that programmers should watch
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Datascience Pizza
🍕 Repositório para juntar informações sobre materiais de estudo em análise de dados e áreas afins, empresas que trabalham com dados e dicionário de conceitos
Stars: ✭ 2,043 (+1168.94%)
Mutual labels:  hacktoberfest
Elm Language Client Vscode
Improving your Elm experience since 2019
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Mobile.buildtools
The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Assertj Core
AssertJ is a library providing easy to use rich typed assertions
Stars: ✭ 2,085 (+1195.03%)
Mutual labels:  hacktoberfest
Libwww Perl
The libwww-perl collection is a set of Perl modules which provides a simple and consistent application programming interface to the World-Wide Web. The main focus of the library is to provide classes and functions that allow you to write WWW clients. The library also contain modules that are of more general use and even classes that help you implement simple HTTP servers.
Stars: ✭ 161 (+0%)
Mutual labels:  hacktoberfest
Web Shells
Some of the best web shells that you might need!
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Elm Geometry
2D/3D geometry package for Elm
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Emacs Fsharp Mode
F# Emacs mode
Stars: ✭ 160 (-0.62%)
Mutual labels:  hacktoberfest
Isbgpsafeyet.com
Is BGP safe yet?
Stars: ✭ 163 (+1.24%)
Mutual labels:  hacktoberfest
Acre2
Advanced Combat Radio Environment 2 (ACRE2) for Arma 3
Stars: ✭ 161 (+0%)
Mutual labels:  hacktoberfest
Ember Cli Addon Docs
Easy, beautiful docs for your OSS Ember addons
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Chainrules.jl
forward and reverse mode automatic differentiation primitives for Julia Base + StdLibs
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest
Sveltejs Forms
Declarative forms for Svelte
Stars: ✭ 163 (+1.24%)
Mutual labels:  hacktoberfest
Pursuedpybear
A python game engine.
Stars: ✭ 162 (+0.62%)
Mutual labels:  hacktoberfest

Tsoding Build Status Build Status

Snitch

A simple tool that collects TODOs in the source code and reports them as GitHub issues.

How it works

  1. Snitch finds an unreported TODO,
  2. Reports it to the GitHub as an issue,
  3. Assigns the Issue number to the TODO marking it a reported,
  4. Commits the reported TODO to the git repo,
  5. Repeats the process until all of the unreported TODOs are reported.

After that you are supposed to push the new reported TODOs yourself.

TODO Format

Unreported TODO

Example

// TODO: rewrite this in Rust

Parsing

Regular expression: ^(.*)TODO: (.*)$ Play

Capture Groups:

  • Group 1: Prefix. Used only to precisly recover the text of the line where the TODO is originally located.
  • Group 2: Suffix. Used as the title of the issue.

Reported TODO

Example

// TODO(#42): rewrite this in Rust

Parsing

Regular expression: ^(.*)TODO\((.*)\): (.*)$ Play

Capture Groups:

  • Group 1: Prefix. Used only to precisly recover the text of the line where the TODO is originally located.
  • Group 2: ID. The number of the Issue.
  • Group 3: Suffix. Used as the title of the issue.

TODO Body

Example

// TODO: rewrite this in Rust
//   I honestly think Rust is going to be around forever,
//   I really do. I think this is like, this is the formation
//   of Ancient Greek.
//   © https://www.reddit.com/r/programmingcirclejerk/comments/ahmnwa/i_honestly_think_rust_is_going_to_be_around/

Parsing

  • Snitch remembers the TODO's prefix.
  • Snitch parses all of the consecutive lines with the same prefix as the body.
  • The body is reported as the Issue Description.

Remote specification

By default Snitch will automatically reference the origin remote as the defacto standard for most projects.

However, you can specify which remote Snitch uses on a per repo basis.

.snitch.yaml

Remotes are defined in .snitch.yaml under remote.

Example

title:
  transforms:
    - match: (.*) \*/
      replace: $1
    - match: (.*) \*\}
      replace: $1
keywords:
  - FIXME
remote: &ltremote&gt

Commandline

Remotes can be dynamically specified when Snitch is called.

This will overide a previously defined remote in .snitch.yaml

Example

$ ./snitch report --remote <remote>

Installation

$ go get github.com/tsoding/snitch

Credentials

GitHub Credentials

Snitch obtains GitHub credentials from two places: (default) environment variable or file.

Environment Variable

export GITHUB_PERSONAL_TOKEN = <personal-token> which can be added to .bashrc

File

Config file can be stored in one of the following directories:

  • $HOME/.config/snitch/github.ini
  • $HOME/.snitch/github.ini

Format:

[github]
personal_token = <personal-token>

Checkout GitHub Help on how to get the Personal Access Token.

Make sure to enable full access to private repos. For some reason it's required to post issues.

GitLab Credentials

GitLab credentials configuration is similar to GitHub with an exception that you also have to provide the host of the GitLab instance.

Environment Variable

export GITLAB_PERSONAL_TOKEN = <personal-token> which can be added to .bashrc.

Each of the credentials are to be separated by , and in format: <host>:<personal-token>. Credentials without host part, e.g. <personal-token> are interpreted as gitlab.com tokens to maintain backward compatibility and invalid tokens are ignored (prints an error message).

File

Config file can be stored in one of the following directories:

  • $HOME/.config/snitch/gitlab.ini
  • $HOME/.snitch/gitlab.ini

Format:

[gitlab.com]
personal_token = <personal-token>

[gitlab.local]
personal_token = <personal-token>

Checkout GitLab Help on how to get the Personal Access Token. Make sure to enable api scope for the token.

Usage

For usage help just run snitch without any arguments:

$ ./snitch

.snitch.yaml

Custom keywords

You don't have to use TODO as the keyword of a todo you want to "snitch up". The keyword is customizable through .snitch.yaml config:

keywords:
  - TODO
  - FIXME
  - XXX
  - "@todo"

Issue Title Transformation

You can apply project local issue title transformations. Create .snitch.yaml file in the root of the project with the following content:

title:
  transforms:
    - match: (.*) \*/
      replace: $1

This feature is very useful for removing garbage from the Issue Titles. Like */ at the end of C comments.

Development

$ export GOPATH=$PWD
$ go get .
$ go build .

Run tests

$ go test ./...

For a more detailed output:

$ go test -v -cover ./...

Support

You can support my work via

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].