-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
coala-format: Use IDs #981
Comments
coala-format is not compatible with our future plans because results will get several ranges of source code. Expressing this in a format string is awful so we want people to use coala-json instead. Fixes #981
The reason I had proposed coala format earlier was because a lot of linter classes (example atom-linter) uses regex to parse the output. Note : removing this would mean that the current coala-atom plugin stops working. Can't we simply write a new line for every range mentioned in a result - with the same message and other details ? |
It might be worth it to check what pylint does - because it has the code clone thing - and that has 2 different files and 2 different source ranges. So, they must have a solution for this (maybe?) |
We could do that. Does that make sense?
With that there would be no possibility of telling wether those lines belong together or not. Maybe we could introduce an ID?
|
@AbdealiJK @Makman2 what do you think of that id? I like it because people can choose to ignore this complexity. OTOH if they ignore that users might wonder e.g. what the cloned function now is if a plugin decides to ignore that. |
I think they simply put this into the message. The format string supports no such thing: http://docs.pylint.org/output.html Taking IDs is even better IMO because people can use that to reference between the occurrences and if they don't want to do that they can add the ID to the message. "Code clone found (1)" |
I like the id idea, is similar to the serial number bug I had mentioned before. But how do you make sure the ids don't clash ? Is it set at the end while printing? -----Original Message----- It might be worth it to check what pylint does - because it has the code clone thing - and that has 2 different files and 2 different source ranges. So, they must have a solution for this (maybe?) |
TBH it seems this would be the most secure thing to do. I tried having a static |
As @AbdealiJK pointed out in a private chat: we could use a |
See related SO question about ID generation: http://stackoverflow.com/questions/33076453/how-to-create-a-unique-id-in-a-python-class-across-multiple-processes |
The ID is needed for coala-format. See discussion on the related bug. Fixes #981
This solution uses hash and produces suitable numbers, see example output http://pastebin.com/mkm4xVBW |
This is highly complicated imo |
@Makman2 sure, you can revamp the atom plugin code for json. But the reason On Mon, Oct 12, 2015 at 3:58 PM, Makman2 notifications@github.com wrote:
|
@Makman2 coala-format is currently about 10 NCLOC and it is a very useful interface and many linters provide such a thing. This makes using coala far easier for people because they can adjust the format to something they want and are not limited to what we give them. Thus I really think we should keep it. Having IDs for results is not that bad either, we can use the hash for now, if a cleaner solution comes up we simply write a counter object that has those problems. |
Because the
Result
class gets refactored and allows to store multiple result positions/ranges,coala-format
can't work that easily like before since serialization of lists makes it too complicated.Everyone needs to stick with
coala-json
which is anyway more straightforward to use because:coala-format
The text was updated successfully, but these errors were encountered: