-
Notifications
You must be signed in to change notification settings - Fork 71
Update EEP-74 to reflect non-centralized proposal #79
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
base: master
Are you sure you want to change the base?
Conversation
This commit changes the error index to be non-centralized and also irons out a lot of the details on how it is expected to be used with various tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only left a couple of minor nits/questions.
various tools within the Erlang ecosystem, including - but not limited | ||
to - the `erlc` Erlang compiler and the `dialyzer` type checker. | ||
The **Erlang Diagnostic Index** is a standardized way to _catalogue_ | ||
errors/warnings/information messages emitted by various tools and applications |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In LSP there are four levels: the forth is called "hint" (or "WeakWarning" in ELP). We should either add it here, or relax to wording. Maybe "diagnostic codes" instead of "errors/warnings/information messages"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many levels are enough levels will always be hard to know. We added 7 levels to logger and I think we only use 3 in Erlang/OTP :)
I'll try to update the text to relax the wording.
of action. Error codes are _namespaced_ based on the tool that | ||
generates them. Unique codes can be associated to a human-readable | ||
**alias**. | ||
Each diagnostic in an index is identified by a **code** and it is accompanied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the "unique" part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each diagnostic in an index is identified by a **code** and it is accompanied | |
Each diagnostic in an index is identified by a uniqye **code** and it is accompanied |
I meant to remove the "human-readable alias" part, not the unique part. Is the above better?
````markdown | ||
# ERL-0001 - Function head mismatch | ||
|
||
## Error example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe avoid "Error" here.
|
||
## Error example | ||
|
||
```erlang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any way we could leverage doctests here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we would like to allow doc tests on all "extra" pages as well (right now it is only for module documentation). Though that is not really related to the EEP.
error) we relief tools from having to condense a lot of textual | ||
information into a - sometime cryptic - generic, single | ||
By associating a **unique code** to each _diagnostic_ (warning, | ||
error or information) we relieve tools from having to condense a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the "hint" severity or simply drop the listing.
The namespaces for diagnostic indexes are not maintained centrally, but | ||
left up to the community to co-ordinate. It is recommended that one | ||
searches online before taking a namespace, just as when deciding on an | ||
application name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You appear to claim Ericsson should determine all namespaces used with Erlang errors, is that correct? Why not add a namespace concept to the Erlang programming language, to avoid a central naming bottleneck?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You appear to claim Ericsson should determine all namespaces used with Erlang errors, is that correct?
No it is not correct. The intention was to claim the exact opposite, that we should NOT determine any namespace. I think that is quite clear from the text, what made you think that was not so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later on in the document namespaces are defined as examples for Erlang/OTP source code that creates an association between the namespace name and the application name like ERL
== compiler
as shown in the output of application:get_diagnostic("ERL-0001")
. The situation would be a lot simpler if we could just use application names as namespaces. Why add a separate name as a namespace that still must be associated with an application name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original proposal the error index namespace was not tied to an application, so I continued with using the new namespace. I did considered using the application name for the namespace, but as I don't expect there to be a lot of tools producing diagnostic codes I decided to decouple them in order to allow using a shorter prefix for the diagnostic code.
It is of course allowed for a tool to use the application name as the namespace.
This commit changes the error index to be non-centralized and also irons out a lot of the details on how it is expected to be used with various tools.
/cc @robertoaloi