Skip to content

Commit

Permalink
major: Remove default setting for defaultInferredScope
Browse files Browse the repository at this point in the history
Fixes #195
  • Loading branch information
ajoberstar committed Apr 22, 2023
1 parent a4490a8 commit b2f51fb
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ reckon {
// snapshotFromProp()
// END LEGACY
// omit this to use the default of 'minor'
// required as of 0.18.0 (previously defaulted to 'minor')
defaultInferredScope = 'patch'
// omit this to use the deafult of 'patch'
// omit this to use the default of 'patch'
// if you use branches like maintenance/1.2.x, set this to 'minor'
// if you use branches like maintenance/2.x, set this to 'major'
parallelBranchScope = 'minor'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static final class Builder {
private VcsInventorySupplier inventorySupplier;
private ScopeCalculator scopeCalc;
private StageCalculator stageCalc;
private Scope defaultInferredScope = Scope.MINOR;
private Scope defaultInferredScope;
private Scope parallelBranchScope = Scope.PATCH;
private Set<String> stages;
private String defaultStage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private String reckonStage(Scope scope, String stage) {
.scopeCalc(i -> Optional.ofNullable(scope))
.stageCalc((i, v) -> Optional.ofNullable(stage))
.stages("beta", "milestone", "rc", "final")
.defaultInferredScope(Scope.MINOR)
.build()
.reckon()
.toString();
Expand All @@ -82,6 +83,7 @@ private String reckonSnapshot(Scope scope, String stage) {
.git(git.getRepository())
.scopeCalc(i -> Optional.ofNullable(scope))
.stageCalc((i, v) -> Optional.ofNullable(stage))
.defaultInferredScope(Scope.MINOR)
.snapshots()
.build()
.reckon()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void stagesLowercased(String stage) {
.scopeCalc(i -> Optional.empty())
.stages("beTA", "miLEStone", "RC", "Final")
.stageCalc(StageCalculator.ofUserString((i, v) -> Optional.of(stage)))
.defaultInferredScope(Scope.MINOR)
.build()
.reckon();
}
Expand Down Expand Up @@ -361,6 +362,7 @@ public void doubleConflictingParallelIncrementsHigherScope() {
.parallelBranchScope(Scope.MINOR)
.scopeCalc(i -> Optional.ofNullable(Scope.PATCH))
.stageCalc((i, v) -> Optional.ofNullable("final"))
.defaultInferredScope(Scope.MINOR)
.stages("beta", "milestone", "rc", "final")
.build();

Expand Down Expand Up @@ -586,6 +588,7 @@ private String reckonStage(VcsInventory inventory, Scope scope, String stage) {
.vcs(() -> inventory)
.scopeCalc(i -> Optional.ofNullable(scope))
.stageCalc((i, v) -> Optional.ofNullable(stage))
.defaultInferredScope(Scope.MINOR)
.stages("beta", "milestone", "rc", "final")
.build()
.reckon()
Expand All @@ -598,6 +601,7 @@ private String reckonSnapshot(VcsInventory inventory, Scope scope, String stage)
.vcs(() -> inventory)
.scopeCalc(i -> Optional.ofNullable(scope))
.stageCalc((i, v) -> Optional.ofNullable(stage))
.defaultInferredScope(Scope.MINOR)
.snapshots()
.build()
.reckon()
Expand Down
1 change: 1 addition & 0 deletions reckon-gradle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {

// testing
compatTestImplementation(gradleTestKit())
compatTestImplementation("org.eclipse.jgit:org.eclipse.jgit:[6.0,7.0[")
compatTestImplementation("org.spockframework:spock-core:2.3-groovy-3.0")
}

Expand Down
6 changes: 3 additions & 3 deletions reckon-gradle/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.github.zafarkhaja:java-semver:0.9.0=runtimeClasspath,testRuntimeClasspath
com.googlecode.javaewah:JavaEWAH:1.1.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
com.googlecode.javaewah:JavaEWAH:1.1.13=compatTestCompileClasspath,compatTestRuntimeClasspath,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.apache.commons:commons-lang3:3.12.0=runtimeClasspath,testRuntimeClasspath
org.apiguardian:apiguardian-api:1.1.2=compatTestCompileClasspath
org.codehaus.groovy:groovy:3.0.12=compatTestCompileClasspath,compatTestRuntimeClasspath
org.eclipse.jgit:org.eclipse.jgit:6.5.0.202303070854-r=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jgit:org.eclipse.jgit:6.5.0.202303070854-r=compatTestCompileClasspath,compatTestRuntimeClasspath,compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.hamcrest:hamcrest:2.2=compatTestCompileClasspath,compatTestRuntimeClasspath
org.junit.platform:junit-platform-commons:1.9.0=compatTestCompileClasspath,compatTestRuntimeClasspath
org.junit.platform:junit-platform-engine:1.9.0=compatTestCompileClasspath,compatTestRuntimeClasspath
org.junit:junit-bom:5.9.0=compatTestCompileClasspath,compatTestRuntimeClasspath
org.opentest4j:opentest4j:1.2.0=compatTestCompileClasspath,compatTestRuntimeClasspath
org.slf4j:slf4j-api:1.7.30=compileClasspath,testCompileClasspath
org.slf4j:slf4j-api:1.7.30=compatTestCompileClasspath,compatTestRuntimeClasspath,compileClasspath,testCompileClasspath
org.slf4j:slf4j-api:2.0.7=runtimeClasspath,testRuntimeClasspath
org.spockframework:spock-core:2.3-groovy-3.0=compatTestCompileClasspath,compatTestRuntimeClasspath
empty=annotationProcessor,compatTestAnnotationProcessor,signatures,testAnnotationProcessor
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
}
Expand Down Expand Up @@ -91,6 +92,7 @@ plugins {
println version
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
}
Expand Down Expand Up @@ -142,6 +144,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
snapshotFromProp()
}
Expand All @@ -165,6 +168,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
}
Expand All @@ -190,6 +194,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
stages('alpha','beta', 'final')
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
stageCalc = calcStageFromProp()
Expand All @@ -216,6 +221,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
stages('alpha','beta', 'final')
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
stageCalc = calcStageFromProp()
Expand All @@ -242,6 +248,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
remote = 'other-remote'
Expand Down Expand Up @@ -270,6 +277,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
Expand Down Expand Up @@ -301,6 +309,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
tagMessage = version.map(v -> "Version " + v)
Expand Down Expand Up @@ -329,6 +338,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha', 'beta', 'final')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('beta', 'final')
}
Expand All @@ -52,6 +53,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('beta', 'final')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
}
Expand Down Expand Up @@ -118,6 +119,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
snapshotFromProp()
}
Expand All @@ -141,6 +143,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
}
Expand All @@ -166,6 +169,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
stages('alpha','beta', 'final')
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
stageCalc = calcStageFromProp()
Expand All @@ -192,6 +196,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
stages('alpha','beta', 'final')
scopeCalc = calcScopeFromProp().or(calcScopeFromCommitMessages())
stageCalc = calcStageFromProp()
Expand All @@ -218,6 +223,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
remote = 'other-remote'
Expand Down Expand Up @@ -246,6 +252,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
Expand Down Expand Up @@ -277,6 +284,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha','beta', 'final')
tagMessage = version.map(v -> "Version " + v)
Expand Down Expand Up @@ -305,6 +313,7 @@ plugins {
}
reckon {
defaultInferredScope = 'minor'
scopeFromProp()
stageFromProp('alpha', 'beta', 'final')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private Version reckonVersion() {
try {
reckoner = reckonerBuilder.build();
} catch (Exception e) {
throw new ReckonConfigurationException("Failed to configure Reckon.", e);
throw new ReckonConfigurationException("Failed to configure Reckon: " + e.getMessage(), e);
}

var version = reckoner.reckon();
Expand Down

0 comments on commit b2f51fb

Please sign in to comment.