metanorma / metanorma-standoc

Metanorma for Standoc documents
BSD 2-Clause "Simplified" License
5 stars 2 forks source link

Provide means to disable a specific log message #927

Open opoudjis opened 1 month ago

opoudjis commented 1 month ago

Would like to disable logged errors in Metanorma source, as known issues to ignore; requirement raised by @TRThurman and @stuartgalt

How this happens is not obvious, but we likely want to mark up a span of text in Metanorma, and prevent it from raising log errors. The only way I can see of doing this is with an annotation of type ignore-log, and bookmarks for the span of text involved. So:

[[shall]]
NOTE: this error [[shall1]] SHALL [[shall2]] be ignored.

[from=shall1,to=shall2,type=ignore-log]
****
****

[from=shall,type=ignore-log,author=NN,date=20240919]
****
This is why I disabled the markup
****

It's cumbersome (and I'm not sure that the inline bookmarks will even work in disabling warnings), but if you're going to disable log messages as coming from particular parts of the marked up text, you have to have a mechanism telling it where the disabling needs to happen. And if you're going to disable error logging for a passage, you really should be saying why and when.

stuartgalt commented 1 month ago

@opoudjis thanks for the comment. It looks like marking up the source is not as neat and clean as initially hoped. It also leads to having things in the source that will need to be managed is we suddenly decide that an a particular error (or multiple of that error) are not a false positive and need to be changed.

I noticed that there are things that look like uuids associated with an error. Would those be consistent from run to run or are does it include a component of a time stamp rather than being based purely on the content? If they are consistent it should be possible to keep a list of the false positives or ones we want to ignore and prune them from the log and then decided if the build/document is "good" or not.

opoudjis commented 1 month ago

The UUIDs are a hash of content, no timestamp.