Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f3feda0e
Commit
f3feda0e
authored
Dec 05, 2018
by
Remco Haszing
Committed by
Evan Read
Dec 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: Update code_quality.md
parent
d052d768
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
doc/user/project/merge_requests/code_quality.md
doc/user/project/merge_requests/code_quality.md
+38
-1
No files found.
doc/user/project/merge_requests/code_quality.md
View file @
f3feda0e
...
@@ -31,13 +31,50 @@ For instance, consider the following workflow:
...
@@ -31,13 +31,50 @@ For instance, consider the following workflow:
First of all, you need to define a job in your
`.gitlab-ci.yml`
file that generates the
First of all, you need to define a job in your
`.gitlab-ci.yml`
file that generates the
[
Code Quality report artifact
](
../../../ci/yaml/README.md#artifactsreportscodequality
)
.
[
Code Quality report artifact
](
../../../ci/yaml/README.md#artifactsreportscodequality
)
.
The Code Quality report artifact is a subset of the
[
Code Climate spec
](
https://github.com/codeclimate/spec/blob/master/SPEC.md#data-types
)
.
It must be a JSON file containing an array of objects with the following properties:
| Name | Description |
| ---------------------- | -------------------------------------------------------------------------------------- |
|
`description`
| A description of the code quality violation. |
|
`fingerprint`
| A unique fingerprint to identify the code quality violation. For example, an MD5 hash. |
|
`location.path`
| The relative path to the file containing the code quality violation. |
|
`location.lines.begin`
| The line on which the code quality violation occurred. |
Example:
```
json
[
{
"description"
:
"'unused' is assigned a value but never used."
,
"fingerprint"
:
"7815696ecbf1c96e6894b779456d330e"
,
"location"
:
{
"path"
:
"lib/index.js"
,
"lines"
:
{
"begin"
:
42
}
}
}
]
```
Note:
**Note:**
Although the Code Climate spec supports more properties, those are ignored by GitLab.
For more information on how the Code Quality job should look like, check the
For more information on how the Code Quality job should look like, check the
example on
[
analyzing a project's code quality
](
../../../ci/examples/code_quality.md
)
.
example on
[
analyzing a project's code quality
](
../../../ci/examples/code_quality.md
)
.
GitLab then checks this report, compares the metrics between the source and target
GitLab then checks this report, compares the metrics between the source and target
branches, and shows the information right on the merge request.
branches, and shows the information right on the merge request.
>**Note:**
Caution:
**Caution:**
If multiple jobs in a pipeline generate a code quality artifact, only the artifact from
the last created job (the job with the largest job ID) is used. To avoid confusion,
configure only one job to generate a code quality artifact.
Note:
**Note:**
If the Code Quality report doesn't have anything to compare to, no information
If the Code Quality report doesn't have anything to compare to, no information
will be displayed in the merge request area. That is the case when you add the
will be displayed in the merge request area. That is the case when you add the
Code Quality job in your
`.gitlab-ci.yml`
for the very first time.
Code Quality job in your
`.gitlab-ci.yml`
for the very first time.
...
...
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