8000 check docs task + default markdown format by pxp9 · Pull Request #11 · pxp9/lazy_doc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

check docs task + default markdown format #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ jobs:
run: mix credo --strict
if: ${{ matrix.lint }}

- name: Run lazy_doc check
run: mix lazy_doc.check
if: ${{ matrix.lint }}

- name: Run mix test
run: mix test

Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ provider which is a tuple of two elements `{GithubAi, :codestral}`.
- Customizable number of retries.
- Custom paramters to pass the model (max\_tokens, top\_p, temperature).
- Run mix format after writing the files, just in case.
- Improve the default prompt to generate markdown syntax.
- Make a task or an arg in the current task to check if the functions are
documented. (allows CI usage)

## Installation

Expand Down Expand Up @@ -63,9 +60,17 @@ mix lazy_doc

I would recommend to run a `mix format` after just in case.

If you want, you can add a simple check to see what needs to be documented in
your project. This is good for CI.

``` bash
mix lazy_doc.check
```

## Known limitations that wont be fixed.

### Module names in the same file must be different.

If the user creates an inner module with the same name as the parent module
`lazy_doc`, it wont work properly because they have the same `:__aliases__` AST
node.
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ config :lazy_doc, :provider, {GithubAi, :gpt_4o_mini}

config :lazy_doc,
:custom_function_prompt,
"You should describe the parameters based on the spec given and give a small description of the following function.\n\nPlease do it in the following format given as an example, important do not return the header of the function, do not return a explanation of the function, your output must be only the docs in the following format.\n\n@doc \"\"\"\n\nParameters\n\ntransaction_id - foreign key of the Transactions table.\nDescription\n Performs a search in the database\n\nReturns\n the Transaction corresponding to transaction_id\n\n\"\"\"\n\nFunction to document:\n"
~s(You should describe the parameters based on the spec given and give a small description of the following function.\n\nPlease do it in the following format given as an example, important do not return the header of the function, do not return a explanation of the function, your output must be only the docs in the following format.\n\n@doc """\n\n## Parameters\n\n- transaction_id - foreign key of the Transactions table.\n## Description\n Performs a search in the database\n\n## Returns\n the Transaction corresponding to transaction_id\n\n"""\n\nFunction to document:\n)

config :lazy_doc, :path_wildcard, "lib/**/*.ex"
Loading
0