Coder Social home page Coder Social logo

quickfix.py's Introduction

quickfix.py

image image Documentation Status

Run a Python script and format the exception traceback as Vim quickfix.

Installation

pip install --user quickfix-py

or using pipx

pipx install --spec git+https://github.com/tonyxty/quickfix.py quickfix-py

Usage

quickfix.py foobar.py foo bar

runs foobar.py with command line arguments foo bar under supervision. Once an exception is raised, quickfix.py prints the stack traceback in Vim quickfix format, one frame per line.

docs/vimrc_example provides an example vimrc configuration.

Currently only works for Python 3.x.

Command line options

  • By default, only those frames that are in "user" scripts are printed, standard library calls are skipped. --all enables printing all frames.
  • By default, quickfix.py catches Exceptions, but not KeyboardInterrupt. --interrupt enables catching ^C, thereby allowing conveniently locating an infinite loop.

thef__k mode

quickfix.py also supports "thefuck" mode, inspired by nvbn/thefuck. When --fuck option is given or the script is run as "thefuck.py", it outputs a line of command that opens sensible-editor at the location of exception. See docs/bashrc_example for idiomatic usages.

Credits

Authored by Tony Beta Lambda. This package was created with Cookiecutter and the ashwinvis/cookiecutter-pypackage project template.

quickfix.py's People

Contributors

ashwinvis avatar tonyxty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

quickfix.py's Issues

Does not execute unittests

  • quickfix.py version: 0.0.0
  • Python version: 3.7.3
  • Operating System: Linux

Description

quickfix.py cannot run a file containing a unittest testcase.

What I Did

Create a file called unittest_failure.py

import unittest



class FalingTest(unittest.TestCase):
    def test_oops(self):
        raise ValueError("Oops!")


if __name__ == "__main__":
    unittest.main()
❯❯❯ python unittest_failure.py                                                                                                        (quickfix.py)
E
======================================================================
ERROR: test_oops (__main__.FalingTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "unittest_failure.py", line 7, in test_oops
    raise ValueError("Oops!")
ValueError: Oops!

----------------------------------------------------------------------
Ran 1 test in 0.000s

❯❯❯ quickfix.py unittest_failure.py                                                                                                  (quickfix.py)

----------------------------------------------------------------------
Ran 0 tests in 0.000s

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.