-
Notifications
You must be signed in to change notification settings - Fork 21
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
@format collides with edoc #243
Comments
Apparently it is just a warning, but still could be worth cleaning up. |
Indeed. It looks like this… /path/to/file.erl, function my_fun/0: at line 3: warning: tag @format not recognized. …or… /path/to/file.erl, in module header: at line 3: warning: tag @format not recognized. …even if you write it like this: %%% @doc This module description.
%%% More docs.
%%% @end
%%% @format ignore. |
But that means that we can't just use another word. We need a different way to tag stuff… and we risk |
That is a very good point, hmmm. |
I was thinking something like |
We could use user-defined macros, i.e. {edoc_opts, [{def, [{format, ""}]}]}. Not sure if a plugin can auto-add that thing so the user doesn't need to do it manually. |
Aha okay, but if they do not add it, they still just get a warning right? |
Right! |
Then this sounds very promising. |
I have not checked this, but apparently edoc does allow comments inside edoc, such that the following won't be picked up by edoc as documentation, since it is a comment inside a comment.
Notice the space between the two percentages. |
Haha, so hackish. I love it. I wonder if documenting it as such, though, will be more of a headache than not. (even with a "Caveats" section, developers don't often read doc.s). |
Yeah it is true and probably the main concern, but whatever we pick this would be the new default for |
I will do a bit of checking of these options on Wednesday, I hope. |
If I add the comment
and run
Then I don't get a warning and I haven't even added any |
Ah I see, I only get the warning if it is after a |
For context, I tried with |
Ah nice, yes even with
And the warning goes away if I add
to the rebar.config If however I write only
without any If I write
without any |
What if you use |
All configurations with
|
So looks like both options:
and
would not create any warnings from edoc or extra text in generated by edoc |
From a require_pragma standpoint is easy to support all variants. |
Yeah… on this project we don't care about pragmas… and we already have support for |
I am going to take a stab at implement the single space and see how it goes. |
Actually forgot that |
Decided on
This was after we did a new analyses, to find that triple percentage is actually quite popular, before the module pragma |
As detected by @awalterschulze on WhatsApp/erlfmt#277, we probably need a new tag format.
The text was updated successfully, but these errors were encountered: