I'm conflicted about scholarly opinion about hiding sins. Like especially when it comes to marriage. I've seen scholars say you shouldn't disclose the sins, but we know that this is something that if it comes up later during the marriage it could destroy a marriage. Ok.
Then scholars when it comes to the issue of adultery, if a spouse commits adultery, and then repents, its something they should hide from their spouse and not reveal. Ok.
But then, what if the wife commits adultery, repents, but then becomes pregnant from the man thats not the husband. Scholars are saying she should not reveal her sin, and the child becomes attributed to her husband. https://islamqa.info/en/answers/94820/she-committed-zina-and-got-pregnant-from-a-stranger-what-should-she-do
This is where I draw the line, and I can't reconcile their opinion with reality. Because in this last scenario, its a great injustice done upon the husband, not only that but you are disrupting the lineage, and attributing someone to other than their father.