Skip to content

Commit

Permalink
Changed gitlab output file type to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen1999 committed Jan 18, 2025
1 parent 3cd6e07 commit 3f8214c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/ci_cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ For GitHub, you can copy [this workflow](https://github.com/Koen1999/suricata-ch

## GitLab

To integrate `suricata-check` with GitLab, you need to run it in a workflow with the `--gitlab` option to produce the `suricata-check-gitlab.log` file which follows the required [CodeClimate report / GitLab Code Quality Report format](https://docs.gitlab.com/ee/ci/testing/code_quality.html#code-quality-report-format).
To integrate `suricata-check` with GitLab, you need to run it in a workflow with the `--gitlab` option to produce the `suricata-check-gitlab.json` file which follows the required [CodeClimate report / GitLab Code Quality Report format](https://docs.gitlab.com/ee/ci/testing/code_quality.html#code-quality-report-format).

To have GitLab process this output, you need to declare the code quality report using the syntax prescribed by [GitLab](https://docs.gitlab.com/ee/ci/yaml/artifacts_reports.html#artifactsreportscodequality).
2 changes: 1 addition & 1 deletion suricata_check/suricata_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def __write_output_stats(output: OutputReport, out: str) -> None:

def __write_output_gitlab(output: OutputReport, out: str, rules_file: str) -> None:
with open(
os.path.join(out, "suricata-check-gitlab.log"),
os.path.join(out, "suricata-check-gitlab.json"),
"w",
buffering=io.DEFAULT_BUFFER_SIZE,
) as gitlab_fh:
Expand Down

0 comments on commit 3f8214c

Please sign in to comment.