Skip to content

Commit

Permalink
Update detekt dependency (#114)
Browse files Browse the repository at this point in the history
* Update detekt dependency

* fix tests

* update dependencies

* spotless

* Changelog
  • Loading branch information
ngoulongkam authored Jul 18, 2024
1 parent 7ae28fe commit df6ced3
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 118 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
- Update dependencies.

## [2.12.2] - 2024-07-17Z
- Format README to fix swift package release.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ version = System.getenv("BITRISE_GIT_TAG") ?: ("SNAPSHOT-" + getDate())

plugins {
`maven-publish`
kotlin("multiplatform").version("1.9.20")
kotlin("multiplatform").version("1.9.24")
java
id("io.gitlab.arturbosch.detekt").version("1.6.0")
id("io.gitlab.arturbosch.detekt").version("1.23.6")
id("com.chromaticnoise.multiplatform-swiftpackage").version("2.0.3")
id("org.jetbrains.kotlinx.kover") version "0.7.6"
}
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/uk/gov/hmrc/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object Dependencies {

object Versions {
const val klockVersion = "2.4.13"
const val kermitVersion = "1.2.2"
const val kermitVersion = "2.0.4"
const val junit5Version = "3.4.2"
const val jupiterEngineVersion = "5.7.1"
const val jupiterEngineVersion = "5.10.3"
}
122 changes: 11 additions & 111 deletions detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ complexity:
ignoreSimpleWhenEntries: false
LabeledExpression:
active: false
ignoredLabels: ""
ignoredLabels: [""]
LargeClass:
active: true
threshold: 600
Expand Down Expand Up @@ -132,7 +132,7 @@ exceptions:
active: true
ExceptionRaisedInUnexpectedLocation:
active: false
methodNames: 'toString,hashCode,equals,finalize'
methodNames: ['toString,hashCode,equals,finalize']
InstanceOfCheckForException:
active: false
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
Expand All @@ -146,14 +146,14 @@ exceptions:
active: false
SwallowedException:
active: false
ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException'
ignoredExceptionTypes: ['InterruptedException,NumberFormatException,ParseException,MalformedURLException']
ThrowingExceptionFromFinally:
active: false
ThrowingExceptionInMain:
active: false
ThrowingExceptionsWithoutMessageOrCause:
active: false
exceptions: 'IllegalArgumentException,IllegalStateException,IOException'
exceptions: ['IllegalArgumentException,IllegalStateException,IOException']
ThrowingNewInstanceOfSameException:
active: false
TooGenericExceptionCaught:
Expand All @@ -177,106 +177,6 @@ exceptions:
- Throwable
- RuntimeException

formatting:
active: true
android: false
autoCorrect: true
AnnotationOnSeparateLine:
active: false
ChainWrapping:
active: true
autoCorrect: true
CommentSpacing:
active: true
autoCorrect: true
Filename:
active: true
FinalNewline:
active: true
autoCorrect: true
ImportOrdering:
active: false
Indentation:
active: false
indentSize: 4
continuationIndentSize: 4
MaximumLineLength:
active: true
maxLineLength: 120
ModifierOrdering:
active: true
autoCorrect: true
MultiLineIfElse:
active: true
autoCorrect: true
NoBlankLineBeforeRbrace:
active: true
autoCorrect: true
NoConsecutiveBlankLines:
active: true
autoCorrect: true
NoEmptyClassBody:
active: true
autoCorrect: true
NoLineBreakAfterElse:
active: true
autoCorrect: true
NoLineBreakBeforeAssignment:
active: true
autoCorrect: true
NoMultipleSpaces:
active: true
autoCorrect: true
NoSemicolons:
active: true
autoCorrect: true
NoTrailingSpaces:
active: true
autoCorrect: true
NoUnitReturn:
active: true
autoCorrect: true
NoUnusedImports:
active: true
autoCorrect: true
NoWildcardImports:
active: true
autoCorrect: true
PackageName:
active: true
autoCorrect: true
ParameterListWrapping:
active: true
autoCorrect: true
indentSize: 4
SpacingAroundColon:
active: true
autoCorrect: true
SpacingAroundComma:
active: true
autoCorrect: true
SpacingAroundCurly:
active: true
autoCorrect: true
SpacingAroundDot:
active: true
autoCorrect: true
SpacingAroundKeyword:
active: true
autoCorrect: true
SpacingAroundOperators:
active: true
autoCorrect: true
SpacingAroundParens:
active: true
autoCorrect: true
SpacingAroundRangeOperator:
active: true
autoCorrect: true
StringTemplate:
active: true
autoCorrect: true

naming:
active: true
ClassNaming:
Expand All @@ -296,7 +196,7 @@ naming:
ForbiddenClassName:
active: false
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
forbiddenName: ''
forbiddenName: ['']
FunctionMaxLength:
active: false
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
Expand Down Expand Up @@ -414,7 +314,7 @@ style:
active: false
DataClassContainsFunctions:
active: false
conversionFunctionPrefix: 'to'
conversionFunctionPrefix: ['to']
DataClassShouldBeImmutable:
active: false
EqualsNullCall:
Expand All @@ -431,14 +331,14 @@ style:
values: 'TODO:,FIXME:,STOPSHIP:'
ForbiddenImport:
active: false
imports: ''
imports: ['']
ForbiddenVoid:
active: false
ignoreOverridden: false
FunctionOnlyReturningConstant:
active: false
ignoreOverridableFunction: true
excludedFunctions: 'describeContents'
excludedFunctions: ['describeContents']
LibraryCodeMustSpecifyReturnType:
active: false
LoopWithTooManyJumpStatements:
Expand All @@ -447,7 +347,7 @@ style:
MagicNumber:
active: false
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
ignoreNumbers: '-1,0,1,2'
ignoreNumbers: ['-1,0,1,2']
ignoreHashCodeFunction: true
ignorePropertyDeclaration: false
ignoreConstantDeclaration: true
Expand Down Expand Up @@ -489,7 +389,7 @@ style:
ReturnCount:
active: true
max: 2
excludedFunctions: "equals"
excludedFunctions: ["equals"]
excludeLabeled: false
excludeReturnFromLambda: true
SafeCast:
Expand Down Expand Up @@ -542,4 +442,4 @@ style:
WildcardImport:
active: true
excludes: "**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt"
excludeImports: 'java.util.*,kotlinx.android.synthetic.*'
excludeImports: ['java.util.*,kotlinx.android.synthetic.*']
1 change: 1 addition & 0 deletions src/commonMain/kotlin/uk/gov/hmrc/calculator/Calculator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import uk.gov.hmrc.calculator.utils.validation.PensionValidator
import uk.gov.hmrc.calculator.utils.validation.WageValidator
import kotlin.jvm.JvmOverloads

@Suppress("LongParameterList")
class Calculator @JvmOverloads constructor(
private val taxCode: String,
private val userPaysScottishTax: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ data class StudentLoanAmountBreakdown(
var amount: Double,
)

@Suppress("LongParameterList")
class CalculatorResponsePayPeriod(
val payPeriod: PayPeriod,
val taxToPayForPayPeriod: Double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import uk.gov.hmrc.calculator.model.TaxYear
import uk.gov.hmrc.calculator.model.pension.PensionMethod
import uk.gov.hmrc.calculator.utils.prettyPrintDataClass

@Suppress("LongParameterList", "TooManyFunctions")
internal class ParameterizedCalculatorTests {

@ParameterizedTest(name = "tax_code={0}, wages={1}, pay_period={2}, tax_year={3}, is_pension_age={4}")
Expand Down Expand Up @@ -552,16 +553,25 @@ internal class ParameterizedCalculatorTests {
val yearlyPeriod = response.yearly
println(inputTaxCode)
println(yearlyPeriod.prettyPrintDataClass())
println("expectedYearlyNiEmployer=$expectedYearlyNiEmployer, yearlyPeriod.employersNI=$yearlyPeriod.employersNI")
println(
"expectedYearlyNiEmployer=$expectedYearlyNiEmployer, " +
"yearlyPeriod.employersNI=$yearlyPeriod.employersNI"
)
assertEquals(PayPeriod.YEARLY, yearlyPeriod.payPeriod)
assertEquals(expectedYearlyNiEmployee, yearlyPeriod.employeesNI, "Yearly employee NI did not match")
assertEquals(expectedYearlyNiEmployer, yearlyPeriod.employersNI, "Yearly employer NI did not match")
assertEquals(expectedYearlyIncomeTax, yearlyPeriod.taxToPay, "Yearly income tax did not match")
assertEquals(expectedYearlyTotalDeduction, yearlyPeriod.totalDeductions, "Yearly total deductions did not match")
assertEquals(
expectedYearlyTotalDeduction, yearlyPeriod.totalDeductions,
"Yearly total deductions did not match"
)
assertEquals(expectedYearlyTakeHome, yearlyPeriod.takeHome, "Yearly take home did not match")
assertEquals(expectedYearlyWages, yearlyPeriod.wages, "Yearly wages did not match")
assertEquals(expectedYearlyTaxFreeAmount, yearlyPeriod.taxFree, "Yearly tax free amount did not match")
assertEquals(expectedYearlyKCodeAdjustment, yearlyPeriod.kCodeAdjustment, "Yearly K code adjustment did not match")
assertEquals(
expectedYearlyKCodeAdjustment, yearlyPeriod.kCodeAdjustment,
"Yearly K code adjustment did not match"
)
assertFalse(yearlyPeriod.maxTaxAmountExceeded)

assertEquals(PayPeriod.MONTHLY, response.monthly.payPeriod)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import uk.gov.hmrc.calculator.model.TaxYear
import uk.gov.hmrc.calculator.utils.prettyPrintDataClass
import kotlin.test.assertEquals

@Suppress("LongParameterList")
class StudentLoanParameterizedTests {

@ParameterizedTest(name = "wages={0}")
Expand Down

0 comments on commit df6ced3

Please sign in to comment.