pxp9

pxp9

LazyDoc - detect undocumented functions and pass the function to an AI provider to document it

Meet my trip building LazyDoc from scratch, exploring Elixir ASTs and combine it with a simple AI prompt you can generate fairly accurate documentation.

Lazy Doc is a project for those who are lazy to document their code. It is designed to detect undocumented functions and pass the function to an AI provider to document it.

https://github.com/pxp9/lazy_doc

Most Liked

dimitarvp

dimitarvp

Interesting idea. For what it’s worth, I’d have the detection of undocumented functions as a separate library and then build yours on top of it.

pxp9

pxp9

Actually the task and the extraction of the undocumented functions are split in different modules.

but you can use the extraction of the undocumented functions by yourself since these functions are public in this module LazyDoc

al2o3cr

al2o3cr

Output seems reasonable overall. There’s a bug with functions that pattern-match their arguments without naming them, for instance filter_documented_functions. The bindings inside the first argument’s match become the documentation, and the second parameter is entirely ignored.

  def filter_undocumented_functions(
        {module, module_ast, _code_mod, functions},
        {_mod, {_module_doc, function_docs}}
      ) do

filter_undocumented_functions(arg1, arg2)

Returns the filtered list of functions that are documented and visible.

Parameters

  • module - the module from which functions are being filtered.
  • module_ast - the abstract syntax tree of the module.
  • _code_mod - additional code modifications.
  • functions - the list of functions to be filtered.

Last Post!

pxp9

pxp9

@syepes As far as I know, In every Elixir app and library you can create

config/config.exs and config/runtime.exs files. Then just copy paste and modify as you wish what it is in the README.

Is there any reason you wont like to create this files ?

There is no other way to configure the library because the library calls the Application.get_env/3 to get the configuration it needs. Most of the config have nice defaults so you dont even need to configure them.

I think a single way to setup simplifies the way to work to library users.

Thank you for your feedback.

Where Next?

Popular in Announcing Top

zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
jakub-zawislak
Hi everyone, I’m coming from the Symfony (PHP) framework. I like Phoenix, but it has a one thing that was build much better in the Symfo...
New
michalmuskala
Hello everybody. I have just released Jason - a new JSON library. You might be wondering, why do we need a new library? The primary foc...
New
anshuman23
Hello all, I have been working on my proposed project called Tensorflex as part of Google Summer of Code 2018.. Tensorflex can be used f...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10789 141
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement