Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpStatusをハードコーディング→HttpStatusのenumを利用する #271

Open
sunakan opened this issue Oct 23, 2022 · 0 comments
Open

Comments

@sunakan
Copy link
Collaborator

sunakan commented Oct 23, 2022

背景

lintツール:detektのデフォに合わせていきたい(現状は200などの固定値を許している)

config/detekt/detekt-override.yml をなくせたら理想

  #
  # MagicNumber
  #
  # 概要
  # - マジックナンバーはOUT
  #
  MagicNumber:
    active: true
    excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**', '**/*.kts']
    ignoreNumbers: # (default: ['-1', '0', '1', 2])
      - '-1'
      - '0'
      - '1'
      - '2'
      - '200'
      - '201'
      - '400'
      - '401'
      - '403'
      - '404'
      - '422'
      - '500'

実際の対応例

Before

val expectedStatus = 200

After

val expectedStatus = HttpStatus.OK.value()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant