Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
4c533b2a
Commit
4c533b2a
authored
Dec 22, 2017
by
Zaq? Wiedmann
Committed by
Sander van Harmelen
Dec 22, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ci/lint) expose ci lint API (#293)
parent
73276272
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
gitlab.go
gitlab.go
+2
-0
lint.go
lint.go
+32
-0
No files found.
gitlab.go
View file @
4c533b2a
...
...
@@ -209,6 +209,7 @@ type Client struct {
Issues
*
IssuesService
Jobs
*
JobsService
Labels
*
LabelsService
Lint
*
LintService
MergeRequests
*
MergeRequestsService
Milestones
*
MilestonesService
Namespaces
*
NamespacesService
...
...
@@ -284,6 +285,7 @@ func newClient(httpClient *http.Client, tokenType tokenType, token string) *Clie
c
.
Issues
=
&
IssuesService
{
client
:
c
,
timeStats
:
timeStats
}
c
.
Jobs
=
&
JobsService
{
client
:
c
}
c
.
Labels
=
&
LabelsService
{
client
:
c
}
c
.
Lint
=
&
LintService
{
client
:
c
}
c
.
MergeRequests
=
&
MergeRequestsService
{
client
:
c
,
timeStats
:
timeStats
}
c
.
Milestones
=
&
MilestonesService
{
client
:
c
}
c
.
Namespaces
=
&
NamespacesService
{
client
:
c
}
...
...
lint.go
0 → 100644
View file @
4c533b2a
package
gitlab
type
LintService
struct
{
client
*
Client
}
type
LintResponse
struct
{
Status
string
`json:"status"`
Errors
[]
string
`json:"errors"`
}
// Lint validates .gitlab-ci content
//
// GitLab API docs: https://docs.gitlab.com/ce/api/lint.html
func
(
l
*
LintService
)
Lint
(
content
string
,
options
...
OptionFunc
)
(
*
LintResponse
,
*
Response
,
error
)
{
opts
:=
struct
{
Content
string
`json:"content"`
}{
Content
:
content
,
}
req
,
err
:=
l
.
client
.
NewRequest
(
"POST"
,
"ci/lint"
,
opts
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
var
lint
LintResponse
resp
,
err
:=
l
.
client
.
Do
(
req
,
&
lint
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
&
lint
,
resp
,
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment