func CheckEAP()

in internal/platform/eap.go [27:73]


func CheckEAP(buildDateStr string, isEap bool) {
	if !isEap {
		return
	}
	buildDate, err := time.Parse(time.RFC3339, buildDateStr)
	if err != nil {
		log.Fatal("Failed to parse build date")
		return
	}

	//golang:noinspection GoDfaErrorMayBeNotNil
	deadline := buildDate.AddDate(0, 0, 60)
	now := time.Now()
	if now.After(deadline) {
		if qdenv.IsContainer() {
			log.Fatal("EAP license of this Qodana image is expired. Please use \"docker pull\" to update image.")
		}
		log.Fatalf("EAP license of this Qodana linter is expired. Obtain the new one with the latest version of Qodana CLI.")
	} else {
		date := deadline.Format("January 02, 2006")
		if qdenv.IsContainer() {
			println(
				fmt.Sprintf(
					"\nBy using this Docker image, you agree to"+
						"\n- JetBrains Privacy Policy (https://jb.gg/jetbrains-privacy-policy)"+
						"\n- JETBRAINS EAP USER AGREEMENT (https://jb.gg/jetbrains-user-eap)"+
						"\n"+
						"\nThe Docker image includes an evaluation license."+
						"\nThe license will expire on %s."+
						"\nPlease ensure you pull a new image on time.", date,
				),
			)
		} else {
			println(
				fmt.Sprintf(
					"\nBy using this linter, you agree to"+
						"\n- JetBrains Privacy Policy (https://jb.gg/jetbrains-privacy-policy)"+
						"\n- JETBRAINS EAP USER AGREEMENT (https://jb.gg/jetbrains-user-eap)"+
						"\n"+
						"\nThe linter includes an evaluation license."+
						"\nThe license will expire on %s."+
						"\nPlease ensure you obtain a new version on time.", date,
				),
			)
		}
	}
}