Open rpottsoh opened 7 years ago
@rpottosh thanks for reporting this issue. I have not confirmed this, but it looks like configlet is expecting an instance of an exercise and is actually getting nil on line 235. Taking a quick look at the config.json for csharp I see the two-fer exercise has a string value of ”null”
for unlocked_by - It should be null.
https://github.com/exercism/csharp/blob/master/config.json#L67
Could you try sanitizing the json, and change the value to null (manually) and try running tree again. Configlet, doesn’t validate unlocked_by yet so this may be the issue. Please let me know.
@nywilken I have changed "null"
to null
on line 67 of config.json for two-fer
. This resolves the problem and configlet tree .
works fine.
Should configlet lint
catch this, and/or Travis CI? Should I bother posting an issue?
I am going to go ahead and submit a PR to CSharp.
It should probably be caught in a few places. I purposely assumed a well-formed config when tree
executes. Perhaps there should be a few sanity checks + warnings in there.
Definitely lintable and a worthy issue, this one could serve as that issue. Or another one, but leave this one open and I will at least fix the issue in tree
to close it?
@nywilken said:
Configlet, doesn’t validate unlocked_by yet
Sounds like @nywilken may be planning to beef up tree
.
A little late on responses - family vacation. @rpottsoh thanks again for reporting and fixing this within the csharp track. As @tleen said already, this issue can serve as the bug.
@tleen I haven't had a chance to look at your updated PRs just yet so I apologize if this has already been addressed. While looking through the code I saw that we don't actually check that we get a valid item from slugByExercise https://github.com/exercism/configlet/blob/master/cmd/tree.go#L234
I would expect something like
if parent, ok := slugToExercise[e.UnlockedBy]; ok {
parent.childSlugs = append(parent.childSlugs, e.Slug)
}
Sounds like @nywilken may be planning to beef up tree.
There is an open issue/request for validating unlocked_by
and core
when it comes to configlet lint
. I suspect that functionality would've caught this issue.
@nywilken yep I believe it would have but it's ok for tree
to do some sanity checking too. Updating lint
would be the second part of a fix on this.
if parent, ok := slugToExercise[e.UnlockedBy]; ok {
parent.childSlugs = append(parent.childSlugs, e.Slug)
}
More or less that's the fix + some scopy stuff and a warning about the config.
Update:
tree
is crashing when it comes across"null"
when it is expectingnull
.configlet tree .
is crashing when I run it against the CSharp track. It is working fine against Delphi and Ruby.Here is the output I am receiving when I run it against the CSharp track:
Configlet lint is not reporting any problems with CSharp. I am using the 32 bit Windows version of Configlet. Let me know if you need anymore information.