Skip to content
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

Set up DoctestFormatter #427

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

angelikatyborska
Copy link
Contributor

This PR sets up a formatter plugin that deals with doctests, https://hexdocs.pm/doctest_formatter/readme.html

The plugin formats Elixir code in the test according to the rules that apply to the rest of the codebase, and also makes the iex> prompts consistent.

Disclaimer: I'm the author of the plugin, and the plugin was written based on @PragTob's suggestion 🙂

@@ -18,37 +18,39 @@ defmodule Benchee.Conversion do
## Examples

iex> statistics = %Benchee.Statistics{average: 1_000_000.0, ips: 1000.0}
iex> scenario = %Benchee.Scenario{
...>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every iex> prompt that is not the first line of the test, will get changed to ...>. This is not strictly necessary, but it's recommended by the official docs:

Multiline expressions can be used by prefixing subsequent lines with either ...> (recommended) or iex>.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds great, thank you!

@PragTob
Copy link
Member

PragTob commented Feb 28, 2024

This is omega nice! Mega Dzieki!

I'm traveling right now, I'll fix the damn macos build and then merge the MR 😅

I looked the changes over and it's exactly what I was looking for, this is amazing work thank you very much!

IMG_20220109_104347

@PragTob
Copy link
Member

PragTob commented Feb 29, 2024

Thanks a lot @angelikatyborska !

@PragTob PragTob merged commit 5c1fbb4 into bencheeorg:main Feb 29, 2024
21 of 22 checks passed
@angelikatyborska angelikatyborska deleted the add-doctest-formatter branch March 2, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants