<commit_before>package org.amshove.kluent

inline fun <T> assertSoftly(assertions: () -> T): T {
    // Handle the edge case of nested calls to this function by only calling throwCollectedErrors in the
    // outermost verifyAll block
    if (errorCollector.getCollectionMode() == ErrorCollectionMode.Soft) {
        return assertions()
    }
    errorCollector.setCollectionMode(ErrorCollectionMode.Soft)
    return assertions().apply {
        errorCollector.throwCollectedErrors()
    }
}

inline fun <T> assertSoftly(t: T, assertions: T.(T) -> Unit): T {
    return assertSoftly {
        t.assertions(t)
        t
    }
}<commit_msg>Always throw and exit soft collection mode<commit_after>package org.amshove.kluent

inline fun <T> assertSoftly(assertions: () -> T): T {
    // Handle the edge case of nested calls to this function by only calling throwCollectedErrors in the
    // outermost verifyAll block
    if (errorCollector.getCollectionMode() == ErrorCollectionMode.Soft) {
        return assertions()
    }
    errorCollector.setCollectionMode(ErrorCollectionMode.Soft)
    try {
        return assertions()
    } finally {
        errorCollector.throwCollectedErrors()
    }
}

inline fun <T> assertSoftly(t: T, assertions: T.(T) -> Unit): T {
    return assertSoftly {
        t.assertions(t)
        t
    }
}
{'fraction_non_alphanumeric': 0.0987189148455162, 'fraction_numerical': 0.0, 'mean_word_length': 3.124223602484472, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6535201', 'n_tokens_mistral': 389, 'n_tokens_neox': 380, 'n_words': 106}