Skip to main content

#todoon integrates the TODOs in your codebase with your GitHub repository

Project description

image.png

PyPI - Downloads PyPI - Version PyPI - Python Version PyPI - License

TODO or not to do, that is the question

TODO Or Not (#todoon) is, in essence, a simple tool that checks your project for TODO's and FIXME's. You can also integrate this tool into your GitHub workflow via actions, and automate generating issues from the discovered TODO's and FIXME's.

Get the GitHub App

Try it out! (see on PyPi)

pip install todo-or-not

Table of Contents

Examples

Check out this example code and the issues that it yielded!

##########################
# Example usage of #todoon
##########################

def an_unfinished_function():
    # TODO Finish documenting todo-or-not
    print("Hello, I'm not quite done, there's more to do!")
    print("Look at all these things I have to do!")
    a = 1 + 1
    b = a * 2
    print("Okay I'm done!")


def a_broken_function():
    # This line might not show up in the generated issue because it's too far away
    #  from the line that triggered the issue.
    # The search for pertinent lines will stop when it hits a line break or the
    #  maximum number of lines, set by PERTINENT_LINE_LIMIT
    a = [
        1, 1, 2, 3
    ]
    b = sum(a)
    c = b * len(a)
    return c / 0  # FIXME I just don't know why this doesn't work!
    # Notice that this line will be collected

    # But this one won't, because there's some whitespace between it and the trigger!


def a_skipping_example():
    # Since the line below has #todoon in it, the checker will give it a pass even though it has the magic words!
    print("Sometimes you really have to write TODO or FIXME, like this!")  # #todoon


def a_very_pretty_example():
    # TODO Titled Issue! | In this format, you can define a title and a body! Also labels like #example or #enhancement
    print("Check this out!")

Usage

CLI

[Generated by Typer, thanks Typer!]

Usage: todo_check.py [OPTIONS]                                              
                                                                            
Options:                                                                    
  --mode TEXT             [default: print]                                  
  --silent / --no-silent  [default: no-silent]                              
  --force / --no-force    [default: no-force]                               
  --ni TEXT               Copy the contents of other files into a new .todo-
                          ignore                                            
  --xi TEXT               Copy the contents of other files into an existing 
                          .todo-ignore                                      
  --help                  Show this message and exit.       

--mode PRINT : The default configuration, will print the discovered issues to stderr

--mode ISSUE : Will generate issues and submit them via the gh cli, with checks (see Issues)

--silent : Do not exit with a non-zero exit code, even if TODOs and/or FIXMEs are found

--force : Run todo_check without a .todo-ignore. NOT RECOMMENDED! There could be a lot of files in there.

--ni FILENAME : Copy the contents of other files into a NEW .todo-ignore, this option must be specified for each. e.g. --ni .gitignore --ni .prettierignore

--xi FILENAME : Copy the contents of other files into a EXISTING .todo-ignore, this option must be specified for each. e.g. --ni .gitignore --xi .prettierignore

If a file discovered by todoon is not of a supported encoding [see SUPPORTED_ENCODINGS_TODO_CHECK for most up-to-date list] it will be skipped. The number of skipped files is summarized at the end of the run.

Environment Variables

MAXIMUM_ISSUES_GENERATED : default: 8
If in ISSUE mode, will exit the todo_check after a certain number of issues have been generated.

PERTINENT_LINE_LIMIT : default: 8
The greatest number of surrounding lines (in each direction) that will be collected in the body of an issue generated in ISSUE mode (fewer may be gathered if they are broken up by blank lines)

.todo-ignore

A plaintext file in a supported encoding. This file specifies which files and directories that todo_check doesn't need to walk through or analyze. It follows the same syntax as a .gitignore file.

Supported encodings:

  • UTF-8
  • UTF-16

[see SUPPORTED_ENCODINGS_TODOIGNORE for most up-to-date list]

Issues

Issues are generated up to a limit (see Environment Variables) and contain the line which contains the TODO or FIXME and up to $MAXIMUM_ISSUES_GENERATED of the preceding and following lines. See Examples for a good representation of how these look.

Issue generation is best supported from GitHub actions, the YAML included in this repository generates the necessary credentials and keeps them safe for you, so it's the most recommended option. However, if you wish to run this elsewhere, you must supply valid values to each of the following environment variables:

  • GITHUB_REF_NAME
  • GITHUB_REPOSITORY
  • GITHUB_TRIGGERING_ACTOR

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

todo_or_not-0.7.10b0.tar.gz (23.1 kB view hashes)

Uploaded Source

Built Distribution

todo_or_not-0.7.10b0-py3-none-any.whl (22.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page