-
Notifications
You must be signed in to change notification settings - Fork 450
/
languages.go
92 lines (68 loc) · 2.64 KB
/
languages.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// Copyright 2021 Security Scorecard Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package clients
// LanguageName is the name of a language, a customized type of string.
type LanguageName string
// TODO: retrieve all languages supported by GitHub, or add one manually if needed.
// Currently, this is still an incomplete list of languages.
const (
// Go: https://go.dev/
Go LanguageName = "go"
// Python: https://www.python.org/
Python LanguageName = "python"
// JavaScript: https://www.javascript.com/
JavaScript LanguageName = "javascript"
// C++: https://cplusplus.com/
Cpp LanguageName = "c++"
// C: https://www.open-std.org/jtc1/sc22/wg14/
C LanguageName = "c"
// TypeScript: https://www.typescriptlang.org/
TypeScript LanguageName = "typescript"
// Java: https://www.java.com/en/
Java LanguageName = "java"
// C#: https://docs.microsoft.com/en-us/dotnet/csharp/
CSharp LanguageName = "c#"
// Ruby: https://www.ruby-lang.org/
Ruby LanguageName = "ruby"
// PHP: https://www.php.net/
PHP LanguageName = "php"
// Starlark: https://github.com/bazelbuild/starlark
StarLark LanguageName = "starlark"
// Scala: https://www.scala-lang.org/
Scala LanguageName = "scala"
// Kotlin: https://kotlinlang.org/
Kotlin LanguageName = "kotlin"
// Swift: https://github.com/apple/swift
Swift LanguageName = "swift"
// Rust: https://github.com/rust-lang/rust
Rust LanguageName = "rust"
// CMake: https://cmake.org/
CMake LanguageName = "cmake"
// Dockerfile: https://docs.docker.com/engine/reference/builder/
Dockerfile LanguageName = "dockerfile"
// Other indicates other languages not listed by the GitHub API.
Other LanguageName = "other"
// Add more languages here if needed,
// please use lowercases for the LanguageName value.
)
// Language represents a customized struct for languages used by clients.
// A language could be a programming language, or more general,
// such as Dockerfile, CMake, HTML, YAML, etc.
type Language struct {
// Name is the name of this language.
Name LanguageName
// NumLines is the total number of code lines of this language in the repo.
NumLines int
// TODO: add more properties for Language.
}