GitlabCodeQualityBuildLogger.Tool 1.0.7

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global GitlabCodeQualityBuildLogger.Tool --version 1.0.7
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local GitlabCodeQualityBuildLogger.Tool --version 1.0.7
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=GitlabCodeQualityBuildLogger.Tool&version=1.0.7
                    
nuke :add-package GitlabCodeQualityBuildLogger.Tool --version 1.0.7
                    

DotNet.GitlabCodeQualityBuildLogger

LICENSE GitHub Actions GitHub Release

<p align="center"> <img width="1024" src="./.github/images/banner.png"> <br /> An MSBuild logger that outputs build warnings and errors in <a href="https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool">GitLab Code Quality report format</a>. </p>

Features

  • Captures build errors and warnings during dotnet build
  • Outputs JSON in GitLab Code Quality format
  • Automatic severity mapping:
    • Build errors → critical
    • CS* (compiler warnings) → major
    • CA2*/CA5* (security rules) → major
    • CA* (other code analysis) → minor
    • IDE*/SA* (style suggestions) → info
    • Other warnings → minor
  • Generates stable fingerprints for issue tracking

Requirements

  • .NET SDK 6.0 or later (for running the tool)
  • MSBuild-based project

Installation

dotnet new tool-manifest # if you don't have a tool manifest yet
dotnet tool install DotNet.GitlabCodeQualityBuildLogger.Tool

Global

dotnet tool install -g DotNet.GitlabCodeQualityBuildLogger.Tool

Usage

dotnet build -logger:"$(gitlab-code-quality-logger);gl-code-quality-report.json"

GitLab CI Example

build:
  stage: build
  script:
    - dotnet tool restore
    - dotnet build -logger:"$(gitlab-code-quality-logger);gl-code-quality-report.json"
  artifacts:
    reports:
      codequality: gl-code-quality-report.json

Output Format

The logger produces JSON compatible with GitLab's Code Quality report format:

[
  {
    "description": "CS0168: The variable 'x' is declared but never used",
    "check_name": "CS0168",
    "fingerprint": "A1B2C3D4E5F6...",
    "severity": "major",
    "location": {
      "path": "src/MyClass.cs",
      "lines": {
        "begin": 42
      }
    }
  }
]

Motivation

GitLab's Code Quality feature provides a great way to track code issues directly in merge requests. However, there was no simple way to integrate .NET build warnings and errors into this workflow. This logger bridges that gap by converting MSBuild output into GitLab's expected format.

Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the configuration
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

To get started please read the Contribution Guidelines.

Development

Requirements

Build

dotnet build

Test

dotnet test

Project Structure

src/
├── DotNet.GitlabCodeQualityBuildLogger/       # Core logger library (netstandard2.1)
└── DotNet.GitlabCodeQualityBuildLogger.Tool/  # CLI tool wrapper (net9.0)
tests/
└── DotNet.GitlabCodeQualityBuildLogger.Tests/ # xUnit tests

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.1.0 342 12/14/2025
1.0.9 6,246 11/30/2025
1.0.8 169 11/28/2025
1.0.7 186 11/28/2025