<commit_before>package org.ajoberstar.semver.vcs.gradle

import org.ajoberstar.semver.vcs.Scope
import org.ajoberstar.semver.vcs.Stage
import org.ajoberstar.semver.vcs.Vcs
import org.ajoberstar.semver.vcs.Versioner

import java.util.function.Supplier

class SemverExtension {
    Supplier<Versioner> versionerSupplier

    Vcs vcs

    boolean enforcePrecedence = true

    Scope defaultScope = Scope.MINOR

    Stage defaultStage

    Stage getDefaultStage() {
        return defaultStage ?: stages.values().min()
    }

    Map<String, Stage> stages = [:]

    SemverExtension stages(Stage... stages) {
        stages.each { stage ->
            this.stages[stage.name] = stage
        }
        return this
    }

    SemverExtension finalStage() {
        stages(Stage.finalStage())
        return this
    }

    SemverExtension fixedStages(String... names) {
        stages(names.collect { Stage.fixedStage(it) })
        return this
    }

    SemverExtension floatingStages(String... names) {
        stages(names.collect { Stage.floatingStage(it) })
        return this<commit_msg>Fix bug in *stages(Stage...) methods.<commit_after>package org.ajoberstar.semver.vcs.gradle

import org.ajoberstar.semver.vcs.Scope
import org.ajoberstar.semver.vcs.Stage
import org.ajoberstar.semver.vcs.Vcs
import org.ajoberstar.semver.vcs.Versioner

import java.util.function.Supplier

class SemverExtension {
    Supplier<Versioner> versionerSupplier

    Vcs vcs

    boolean enforcePrecedence = true

    Scope defaultScope = Scope.MINOR

    Stage defaultStage

    Stage getDefaultStage() {
        return defaultStage ?: stages.values().min()
    }

    Map<String, Stage> stages = [:]

    SemverExtension stages(Stage... stages) {
        stages.each { stage ->
            this.stages[stage.name] = stage
        }
        return this
    }

    SemverExtension finalStage() {
        stages(Stage.finalStage())
        return this
    }

    SemverExtension fixedStages(String... names) {
        stages(names.collect { Stage.fixedStage(it) } as Stage[])
        return this
    }

    SemverExtension floatingStages(String... names) {
        stages(names.collect { Stage.floatingStage(it) } as Stage[])
        return this
{'fraction_non_alphanumeric': 0.10017969451931716, 'fraction_numerical': 0.0, 'mean_word_length': 2.717863105175292, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1378429', 'n_tokens_mistral': 688, 'n_tokens_neox': 667, 'n_words': 131}