package com.freeleaps.devops.enums

import com.freeleaps.devops.enums.ServiceLanguage

enum CodeLinterTypes {
  PYLINT(ServiceLanguage.PYTHON, "pylint", "docker.io/pipelinecomponents/pylint:latest"),
  ESLINT(ServiceLanguage.JS, "eslint", "docker.io/pipelinecomponents/eslint:latest")

  final ServiceLanguage language
  final String linter
  final String containerImage

  CodeLinterTypes(ServiceLanguage language, String linter, String containerImage) {
    this.language = language
    this.linter = linter
    this.containerImage = containerImage
  }

  static CodeLinterTypes parse(String linter) {
    switch (linter) {
      case 'pylint':
        return CodeLinterTypes.PYLINT
      case 'eslint':
        return CodeLinterTypes.ESLINT
      default:
        return null
    }
  }
}