Git Product home page Git Product logo

annolazy's Introduction

Annolazy

A lazy way to generate annotations in many languages

Currently working on the PHP implementation.

The idea is that you can just point the program at your source directory and have docblocks auto-generated and formatted according to a nice standard/convention, saving the programmer a lot of time in manual comment editing.

Table of Contents

Examples

PHP

Turn some ugly class method like this:

    /**
     * Some small desc
     *
     * @param string  $stringArg This was my string arg desc.
     * @param integer $intArg    This was my int arg desc.
     *
     * @Route(name="_some_symfony_type_thing", url="/one/{two}")
     *
     * @todo I don't like using easy to read routes!
     *
     * @Annot\Some\Custom\Thing Blabla
     *
     * @return void
     */
    public function blub(Tokenizer $tok, string $stringArg, int $intArg): array
    {
        return [$stringArg, $intArg];
    }

into a beautiful PEAR compliant file like this:

    /**
     * Some small desc
     *
     * Long description here TODO
     *
     * @param Tokenizer $tok       Some description here TODO
     * @param string    $stringArg This was my string arg desc.
     * @param integer   $intArg    This was my int arg desc.
     *
     * @Route(name="_some_symfony_type_thing", url="/one/{two}")
     *
     * @todo I don't like using easy to read routes!
     *
     * @Annot\Some\Custom\Thing Blabla
     *
     * @return array
     */
    public function blub(Tokenizer $tok, string $stringArg, int $intArg): array
    {
        return [$stringArg, $intArg];
    }

Setup

Somewhat usable, as long as you're using against a VCS repository so you can audit what it changes!

TODO

PHP

  • Handle abstract/static keywords on functions
  • User customizations for width/space etc.
  • Wordwrap
  • Un-hardcode 4 space indentation for class files (have Tokenizer figure out spacing)
  • Allow more user customizations for short/long/param PHer descs
  • Infer the '@throws' comments based on what throw calls are in function.

About

Maintainer

You can reach me at Matthew Carter [email protected] or file an issue here.

License

AGPLv3

annolazy's People

Contributors

ahungry avatar

Stargazers

 avatar

Watchers

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