tools
tools copied to clipboard
False s-029 message
I've gotten a couple of false s-029's lately, once in a file that had no data-parent, now in a book (Gibbon) that has no data-parents anywhere at all. The actual problem appears to be that the file in question wasn't in the ToC, i.e. rebuilding the ToC makes the error go away.
I've looked at the code, but I'm not sure what's causing the false positive. I mean, it not being in the ToC is an issue, but it's definitely not an s-029, and reporting it as an s-029 when there's no data-parent involved at all is confusing and leads us down the wrong road towards a solution.
Posting in case the cause would be immediately obvious to you.
I think the error message may have gotten corrupted somewhere along the line, because s-029 doesn't check for data-parent
at all. There's an error but the message is incorrect. I'll have to look in to this later.
No problem. At a quick glance, it appears to be the reverse of that: the original commit (d2643ff 1/19/2022) has the current message, but the code did check for data-parent at that point. I've never figured out how to find what made all the changes to a section of code (blame doesn't help here, as the line no longer exists), so that's as far as I've gotten. The other two commit IDs that appear in that section in blame don't have the change to remove the data-parent line.
Grrr, never mind to the last part. The message is indeed the original message, but the code around it didn't contain the check for data-parent, that's the code at the top of lint that walks the spine to build dom_section. Sorry for the confusion.
Do you remember the state of an ebook in which this problem occurred? Something I can test on?
The above situation was where a file wasn't in the ToC (I bolded my explanation above to make it more obvious.) But I got some of these a few days ago, and I want to say that this time the file wasn't in the manifest. Of course, if it wasn't in the manifest/spine, it wouldn't be in the ToC, either, so maybe it's still the ToC that's the problem.
OK... next time you come across this, can you make a minimal test case so I can look at it?
It looks like it's the spine that's the problem, not the ToC itself. Not being in the spine obviously causes it not to be in the ToC, but if it's in the spine, the s-029 doesn't happen. (At least now.)
I just duplicated it by removing a file from the spine (and ToC) that's in the manifest. You get other errors, obviously (f-007, m-045), but the s-029 shows up as well. I won't swear that's what happened when I opened this issue, but it's at least easily reproducible.
OK, I updated it so that it doesn't fire if the file is not in the spine. The message is valid but misleading in that case. If you find this happening again, then a minimal test case would be helpful. Fixed in 8f320d2