-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpythoneol.go
40 lines (33 loc) · 914 Bytes
/
pythoneol.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"cuddly-eureka-/conf/initialize"
"cuddly-eureka-/github"
"cuddly-eureka-/http"
"cuddly-eureka-/plugininternal"
"cuddly-eureka-/types"
"cuddly-eureka-/util"
)
type PythonEOL struct {
}
func (python PythonEOL) Check(repoName string, opts ...*string) types.MaturityCheck {
app := initialize.GetAppConstants()
g := &github.GitHub{}
g = g.Init(app.GitHubToken)
eolDetails, eolErr := http.EOLProvider(http.EOLPython)
if eolErr != nil {
panic("Failed to find EOL details for " + http.EOLPython + " ")
}
var existingVersion = plugininternal.FindPythonVersion(repoName)
if existingVersion != nil {
eolValue := util.CheckEOL(*existingVersion, eolDetails)
return eolValue
}
return types.MaturityValue0
}
func (python PythonEOL) Meta() types.MaturityMeta {
return types.MaturityMeta{
Type: types.MaturityTypeDependency,
Name: "Not EOL: Python",
}
}
var Check PythonEOL