Giter VIP home page Giter VIP logo

codeline's Introduction

Run context-aware commands from your source code comments.


codeline tests

Codeline allows you to run custom commands directly from source-code comments, combining the power of IDE extensions with the expressiveness of the command-line.

Current State

Codeline is functional, and there are two working commands so far (see below). However, it is still in the very-early stages of development.

Please join the discussions, add issues, and get involved.

Installation

  • git clone https://github.com/synek/codeline.git
  • poetry install

Development

Codeline can monitor the current directory for file-changes, and then run any commands it finds:
poetry run codeline --watch .

Alternatively you can run Codeline on a single file, executing any commands the file and then exiting.
poetry run codeline --run path/to/python/file.py

To build a command, copy the plugins/test_plugin as a starting point.

Commands

Currently, commands are implemented as Python plugins. The SDK for building commands is found in codeline/sdk.

Test

The test command doesn't do anything, but shows how commands work.

Example usage:

def some_function():
    # <| test run
    do_something()
    more_stuff()

If Codeline is monitoring the directory, then it will run the command when you save the file.

Commit

This command allows you to automatically commit a "hunk" of code.

Example usage:

# <| commit -m "Adds myfunc() to do something"
def myfunc(data):
    data.do_something()
    print("done")

If Codeline is monitoring the directory, then it will run the command when you save the file.

Future Work

  • Add support for shell scripts
  • Make it possible to pipe commands together
  • Publish documentation for the SDK

Contributing

Codeline is still under heavy development. I will start accepting PRs in a couple of weeks once the development has stabilised a little. However, if you'd like to make a new command for Codeline then please get in touch with me ([email protected]) or open an issue and I'll help.

codeline's People

Contributors

rorybyrne avatar

Watchers

 avatar  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.