Closed sent44 closed 10 months ago
If I understand this correctly, there is a Info: ...
message that's in the json file? That sounds like a nimble bug, have you opened an issue in the nimble repo as well?
As for a temporary fix, I would like to avoid regex if possible. I would prefer if we could just trim off everything before the JSON starts instead. So basically remove everything until the first {
. What do you think?
How about mini lexical analysis? I don't trust crop until {
as it might be false positive and the non --json
make it very easy to do analysis.
About that bug, I do not open issue yet. I just feel lazy to do it.
IMO, this is in principle a nimble bug, and we should not have to do a complex solution to this on our side. We should do the simplest solution possible. This is a general rule of coding that I wish I followed more myself. Implementing our own parser is too complex of a solution in my opinion, but I appreciate the initiative. :D
I don't trust crop until { as it might be false positive
Change the rule to the first {
that is on its own line:
# remove this
{
# keep this
I don't see how nimble would cause a false positive in this case. Even if a path contained a {
it wouldn't affect it.
About that bug, I do not open issue yet. I just feel lazy to do it.
Someone should. That is the correct place to solve this issue. Let me know if you don't plan on opening the issue, and I'll do it myself :)
While I say mini lexical analysis, I mean dumpText.find("version: ")
😅
Oh, then that might actually be simpler 😯 If you make a PR that uses that approach (without using regex), I'm for approving it 😄
I just thought of that after reply to you 😅 Currently outside so I can't do it now
No hurry, take it when you have the time and energy 😁
hi, agree that this is a nimble bug but instead of a workaround for our parsing I found a workaround looking at nimble code for display. There is indeed a --silent
option to make sure that not message is displayed (see e.g. https://github.com/search?q=repo%3Anim-lang%2Fnimble%20SilentPriority&type=code). So the fix is to actually using this option, not changing our parsing
Fixed by #230
https://github.com/pietroppeter/nimib/blob/dc890600a2274aaec8da71f5e16be084a7f15614/src/nimib/config.nim#L9-L11 When using
nimble dump --json
with custom Nimble environment variable, it will also outputInfo: Using the environment variable: ...
at the front of json. So when using that result string withparseJson()
, it will error.