Giter Club home page Giter Club logo

pct-vim's Introduction

pct-vim

PCT-VIM - Precise Code Tracking Vim plugin

by @d0c_s4vage

Intro

This plugin is the vim implementation of the PCT method developed by @tmanning. It is intended to assist in code auditing by enabling one to annotate read-only source code from a text editor. This plugin is the vim implementation. See @tmanning for the textmate implementation.

PCT uses an sqlite3 database to store and query audited ranges of code and notes that were taken/added for line ranges.

Getting started

Follow the steps below to initialize the database:

  1. Install dependencies
  2. Source pct.vim
  3. Open a file in a project that you wish to audit
  4. Run the command below to initialize the database: :PctInit
  5. Begin auditing!

Be aware that the plugin treats the root dirname of the database path as the root of the project. Any files in subfolders of the root project path will be included in reports and are considered "part of the project".

Dependencies

  • Vim
  • Python
  • peewee python module (pip install peewee)

Key mappings

  • Review
    • [r - mark the current/selected line(s) as having been reviewed
  • Generic Comments (Annotations)
    • [a - annotate the current/selected line(s) with a single-line generic comment
    • [A - annotate the current/selected line(s) with a multi-line generic comment
  • Findings
    • [f - annotate the current/selected line(s) with a single-line finding
    • [F - annotate the current/selected line(s) with a multi-line finding
  • Todos
    • [t - annotate the current/selected line(s) with a single-line todo
    • [T - annotate the current/selected line(s) with a multi-line todo
  • Annotation Modification
    • [d - delete an annotation on the current line
  • Reports/Listings
    • [R - toggle the report of the current project
    • [h - show a recent history of notes/reviewed source files
  • Other
    • [o - open the file under the cursor in a new readonly tab (useful for reports)
  • Annotation Navigation
    • [n - jump to the next annotation in the current file
    • [N - jump to the previous annotation in the current file
    • [? - display the current annotation(s) in a vertically-split window

Notes

Note that the only differentiation between annotations/findings/todos is the existence of certain keywords in the annotation. Todos contain the word "TODO" in the text, findings contain the word "FINDING" in the text, and generic annotations don't contain either.

Known Issues

  • sometimes there are issues when viewing existing notes while scrolling through a split file

Future

  • ability to mark files as out-of-scope
  • ability to edit annotations

Screenshots

Lines marked as reviewed

Reviewed lines

A simple note/annotation

Simple note/annotation

A todo

A todo

A finding

A finding

Report and History

PCT Report and History

pct-vim's People

Contributors

cloudburst avatar d0c-s4vage 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.