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.

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

pxp9

Just release version 0.5.4, which fixes all you said.

Where Next?

Popular in Libraries Top

RobertDober
Earmark is a pure-Elixir Markdown converter. It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
239 11851 134
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
deadtrickster
I’ve just released stable versions of my Prometheus Elixir libs: Elixir client [docs]; Ecto collector [docs]; Plugs instrumenter/Export...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
Qqwy
While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Eli...
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
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Sub Categories:

We're in Beta

About us Mission Statement