Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"Tool","Tool Version","Format","Issue Provider","Supported Since"
"[editorconfig-checker](https://editorconfig-checker.github.io/){target='_blank'}",,CodeClimate,"[Cake.Issues.CodeClimate](issue-providers/codeclimate/index.md)",5.7.0
"~~[dupFinder](https://www.jetbrains.com/help/resharper/2021.2/dupFinder.html){target='_blank'}~~{ title='Deprecated since dupFinder Command Line Tool has been sunsetted. See Copy/Paste Detection for alternative tools.' } ",,,"Cake.Issues.DupFinder",0.8.0
"[InspectCode](https://www.jetbrains.com/help/resharper/InspectCode.html){target='_blank'}",,"[xml](https://www.jetbrains.com/help/resharper/InspectCode.html#alternative-output-formats){target='_blank'}","[Cake.Issues.InspectCode](issue-providers/inspectcode/index.md)",0.1.0
"[InspectCode](https://www.jetbrains.com/help/resharper/InspectCode.html){target='_blank'}",">= 2024.1","[SARIF](https://www.jetbrains.com/help/resharper/InspectCode.html#understanding-output){target='_blank'}","[Cake.Issues.Sarif](issue-providers/sarif/index.md)",4.2.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"Tool","Tool Version","Format","Issue Provider","Supported Since"
"[ESLint](https://eslint.org){target='_blank'}","Current","[json](https://eslint.org/docs/latest/use/formatters/#json){target='_blank'}","[Cake.Issues.EsLint](issue-providers/eslint/index.md)",0.1.0
"[ESLint](https://eslint.org){target='_blank'}","Current","[json](https://eslint.org/docs/latest/use/formatters/#json){target='_blank'}","[Cake.Issues.EsLint](issue-providers/eslint/index.md)",0.1.0
"[ESLint](https://eslint.org){target='_blank'}","Current","CodeClimate","[Cake.Issues.CodeClimate](issue-providers/codeclimate/index.md)",5.7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Features
description: Features of the Cake.Issues.CodeClimate addin.
icon: material/creation-outline
---

The [Cake.Issues.CodeClimate addin](https://cakebuild.net/extensions/cake-issues-codeclimate/){target="_blank"} provides the following features.

??? tip "Tip: CodeClimate compatible tools"
The CodeClimate format is supported by many linting and analysis tools including
[ESLint](https://eslint.org/docs/user-guide/formatters/#json-with-metadata){target="_blank"},
[RuboCop](https://docs.rubocop.org/rubocop/formatters.html#codeclimate-formatter){target="_blank"},
[editorconfig-checker](https://github.com/editorconfig-checker/editorconfig-checker){target="_blank"},
and many others.

## Basic features

- [x] Reads issues from CodeClimate compatible JSON format reports.
- [x] Supports both line-based and position-based location formats.
- [x] Maps CodeClimate severity levels to appropriate Cake.Issues priorities.
- [x] Filters to only process entries with `"type": "issue"`, ignoring measurements and other entry types.
- [x] Handles all required and optional CodeClimate fields including `check_name`, `description`, `categories`, `location`, `content`, `severity`, and `fingerprint`.

## Supported location formats

- [x] **Line-based locations**: `{"lines": {"begin": 5, "end": 10}}`
- [x] **Position-based locations**: `{"positions": {"begin": {"line": 5, "column": 10}, "end": {"line": 6, "column": 15}}}`

## Severity mapping

The CodeClimate issue provider maps CodeClimate severity levels to Cake.Issues priorities as follows:

| CodeClimate Severity | Cake.Issues Priority |
|---------------------|---------------------|
| `blocker` | Error |
| `critical` | Error |
| `major` | Warning |
| `minor` | Warning |
| `info` | Suggestion |

## Supported IIssue properties

<div class="annotate" markdown>

- [x] `IIssue.ProviderType`
- [x] `IIssue.ProviderName`
- [ ] `IIssue.Run` (1)
- [x] `IIssue.Identifier` (2)
- [ ] `IIssue.ProjectName`
- [ ] `IIssue.ProjectFileRelativePath`
- [x] `IIssue.AffectedFileRelativePath`
- [x] `IIssue.Line`
- [x] `IIssue.EndLine` (3)
- [x] `IIssue.Column` (4)
- [x] `IIssue.EndColumn` (4)
- [ ] `IIssue.FileLink` (5)
- [x] `IIssue.MessageText`
- [ ] `IIssue.MessageHtml`
- [ ] `IIssue.MessageMarkdown`
- [x] `IIssue.Priority`
- [x] `IIssue.PriorityName`
- [x] `IIssue.RuleId` (6)
- [ ] `IIssue.RuleUrl`

</div>

1. Can be set while reading issues
2. Set to CodeClimate `fingerprint` if available, otherwise generated from other fields
3. Supported for both line-based and position-based locations
4. Only supported for position-based locations
5. Can be set while reading issues
6. Set to CodeClimate `check_name`
14 changes: 14 additions & 0 deletions docs/input/documentation/issue-providers/codeclimate/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: CodeClimate issue provider
description: Issue provider which allows you to read issues from CodeClimate compatible reports.
---

Support for reading issues from [CodeClimate](https://codeclimate.com/){target="_blank"} compatible reports
is implemented in the [Cake.Issues.CodeClimate addin](https://cakebuild.net/extensions/cake-issues-codeclimate/){target="_blank"}.

<div class="grid cards" markdown>

- :material-creation-outline: [Features](features.md)
- :material-api: [API](https://cakebuild.net/extensions/cake-issues-codeclimate){target="_blank"}

</div>
2 changes: 2 additions & 0 deletions docs/input/documentation/issue-providers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Issue provider addins are responsible for providing the output of an analyzer or

<div class="grid cards" markdown>

- :material-layers-plus: __[CodeClimate]__ – Issue provider for reading CodeClimate compatible reports
- :material-layers-plus: __[DocFx]__ – Issue provider for reading DocFx warnings
- :material-layers-plus: __[ESLint]__ – Issue provider for reading ESLint issues
- :material-layers-plus: __[Git Repository]__ – Issue provider for analyzing Git repositories
Expand All @@ -19,6 +20,7 @@ Issue provider addins are responsible for providing the output of an analyzer or

</div>

[CodeClimate]: codeclimate/index.md
[DocFx]: docfx/index.md
[ESLint]: eslint/index.md
[Git Repository]: gitrepository/index.md
Expand Down
59 changes: 59 additions & 0 deletions nuspec/nuget/Cake.Frosting.Issues.CodeClimate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Support for reading CodeClimate compatible files using the Cake.Issues addin for Cake Frosting

> **NOTE**:
> This is the version of the addin compatible with [Cake Frosting].
> For addin compatible with [Cake .NET Tool] see [Cake.Issues.CodeClimate](https://www.nuget.org/packages/Cake.Issues.CodeClimate).

The CodeClimate support for the Cake.Issues addin for Cake allows you to read CodeClimate compatible files.

Cake.Issues redefines issue management within the Cake build system by offering a comprehensive, universal, and extensible solution.
The unique capabilities of the addins empower development teams to enforce coding standards, generate insightful reports,
seamlessly incorporate various linting tools, and streamlining the integration with pull requests.
With its [modular architecture] and extensive [set of aliases], Cake.Issues provides a future-proof infrastructure for issue management
in Cake builds, fostering a more efficient and adaptable development process.

For more information and extensive documentation see the [Cake.Issues website](https://cakeissues.net).
For general information about the Cake build automation system see the [Cake website](http://cakebuild.net).

## How to use

Integrating Cake.Issues into your Cake build is straightforward.
With minimal setup, teams can enjoy the benefits of enhanced code quality management seamlessly integrated into their existing build pipeline.

After adding the addin the CodeClimate log file can be parsed:

```csharp
Task("Analyze").Does(() =>
{
var logPath = @"c:\build\log.json";
var repoRootPath = @"c:\repo";

// Read issues.
var issues =
ReadIssues(
CodeClimateIssuesFromFilePath(logPath),
repoRootPath);

Information("{0} issues are found.", issues.Count());
});
```

## Support & Discussion

For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/orgs/cake-build/discussions/categories/extension-q-a) category.

## Contributing

Contributions are welcome. See [Contribution Guidelines](https://github.com/cake-contrib/Cake.Issues/blob/develop/CONTRIBUTING.md).

## License

[MIT License - Copyright © Cake Issues contributors](LICENSE)

Binary distributions for some addins contain third-party code which is licensed under its own respective license.
See [LICENSE](https://github.com/cake-contrib/Cake.Issues/blob/develop/LICENSE) for details.

[modular architecture]: https://cakeissues.net/latest/documentation/how-cake-issues-works/
[set of aliases]: https://cakeissues.net/latest/api/
[Cake Frosting]: https://cakebuild.net/docs/running-builds/runners/cake-frosting
[Cake .NET Tool]: https://cakebuild.net/docs/running-builds/runners/dotnet-tool
45 changes: 45 additions & 0 deletions nuspec/nuget/Cake.Frosting.Issues.CodeClimate.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Cake.Frosting.Issues.CodeClimate</id>
<title>Cake.Frosting.Issues.CodeClimate</title>
<version>0.0.0</version>
<authors>Cake Issues contributors</authors>
<owners>pascalberger, cake-contrib</owners>
<summary>Support for reading CodeClimate compatible files using the Cake.Issues addin for Cake Frosting</summary>
<description>
The CodeClimate support for the Cake.Issues addin for Cake allows you to read CodeClimate compatible files.

This addin provides the aliases for reading issues from CodeClimate compatible files and providing them to the Cake.Issues addin.
It also requires the core Cake.Issues addin.

There are also additional addins for generating reports or posting issues to pull requests.

See the Project Site for an overview of the whole ecosystem of addins for working with issues in Cake scripts.

NOTE:
This is the version of the addin compatible with Cake Frosting.
For addin compatible with Cake Script Runners see Cake.Issues.CodeClimate.
</description>
<license type="expression">MIT</license>
<projectUrl>https://cakeissues.net</projectUrl>
<icon>icon.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © Cake Issues contributors</copyright>
<tags>cake cake-frosting cake-issues cake-issueprovider linting codeclimate</tags>
<readme>docs\README.md</readme>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/5.6.1</releaseNotes>
<dependencies>
<group targetFramework="net8.0">
</group>
<group targetFramework="net9.0">
</group>
</dependencies>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
<file src="..\..\..\..\nuspec\nuget\Cake.Frosting.Issues.CodeClimate.md" target="docs\README.md" />
<file src="Release\**\Cake.Issues.CodeClimate.*" target="lib" exclude="**\*.deps.json" />
</files>
</package>
15 changes: 15 additions & 0 deletions nuspec/nuget/Cake.Frosting.Issues.CodeClimate.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<PackageId>Cake.Frosting.Issues.CodeClimate</PackageId>
<Title>Cake.Frosting.Issues.CodeClimate</Title>
<Description>Support for reading CodeClimate compatible files using the Cake.Issues addin for Cake Frosting</Description>
<PackageTags>cake cake-frosting cake-issues cake-issueprovider linting codeclimate</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Issues.CodeClimate" Version="$(Version)" />
</ItemGroup>

</Project>
59 changes: 59 additions & 0 deletions nuspec/nuget/Cake.Issues.CodeClimate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Support for reading CodeClimate compatible files using the Cake.Issues addin for Cake Build Automation System

> **NOTE**:
> This is the version of the addin compatible with [Cake .NET Tool].
> For addin compatible with [Cake Frosting] see [Cake.Frosting.Issues.CodeClimate](https://www.nuget.org/packages/Cake.Frosting.Issues.CodeClimate).

The CodeClimate support for the Cake.Issues addin for Cake allows you to read CodeClimate compatible files.

Cake.Issues redefines issue management within the Cake build system by offering a comprehensive, universal, and extensible solution.
The unique capabilities of the addins empower development teams to enforce coding standards, generate insightful reports,
seamlessly incorporate various linting tools, and streamlining the integration with pull requests.
With its [modular architecture] and extensive [set of aliases], Cake.Issues provides a future-proof infrastructure for issue management
in Cake builds, fostering a more efficient and adaptable development process.

For more information and extensive documentation see the [Cake.Issues website](https://cakeissues.net).
For general information about the Cake build automation system see the [Cake website](http://cakebuild.net).

## How to use

Integrating Cake.Issues into your Cake build is straightforward.
With minimal setup, teams can enjoy the benefits of enhanced code quality management seamlessly integrated into their existing build pipeline.

After adding the addin the CodeClimate log file can be parsed:

```csharp
Task("Analyze").Does(() =>
{
var logPath = @"c:\build\log.json";
var repoRootPath = @"c:\repo";

// Read issues.
var issues =
ReadIssues(
CodeClimateIssuesFromFilePath(logPath),
repoRootPath);

Information("{0} issues are found.", issues.Count());
});
```

## Support & Discussion

For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/orgs/cake-build/discussions/categories/extension-q-a) category.

## Contributing

Contributions are welcome. See [Contribution Guidelines](https://github.com/cake-contrib/Cake.Issues/blob/develop/CONTRIBUTING.md).

## License

[MIT License - Copyright © Cake Issues contributors](LICENSE)

Binary distributions for some addins contain third-party code which is licensed under its own respective license.
See [LICENSE](https://github.com/cake-contrib/Cake.Issues/blob/develop/LICENSE) for details.

[modular architecture]: https://cakeissues.net/latest/documentation/how-cake-issues-works/
[set of aliases]: https://cakeissues.net/latest/api/
[Cake Frosting]: https://cakebuild.net/docs/running-builds/runners/cake-frosting
[Cake .NET Tool]: https://cakebuild.net/docs/running-builds/runners/dotnet-tool
45 changes: 45 additions & 0 deletions nuspec/nuget/Cake.Issues.CodeClimate.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Cake.Issues.CodeClimate</id>
<title>Cake.Issues.CodeClimate</title>
<version>0.0.0</version>
<authors>Cake Issues contributors</authors>
<owners>pascalberger, cake-contrib</owners>
<summary>Support for reading CodeClimate compatible files using the Cake.Issues addin for Cake Build Automation System</summary>
<description>
The CodeClimate support for the Cake.Issues addin for Cake allows you to read CodeClimate compatible files.

This addin provides the aliases for reading issues from CodeClimate compatible files and providing them to the Cake.Issues addin.
It also requires the core Cake.Issues addin.

There are also additional addins for generating reports or posting issues to pull requests.

See the Project Site for an overview of the whole ecosystem of addins for working with issues in Cake scripts.

NOTE:
This is the version of the addin compatible with Cake Script Runners.
For addin compatible with Cake Frosting see Cake.Frosting.Issues.CodeClimate.
</description>
<license type="expression">MIT</license>
<projectUrl>https://cakeissues.net</projectUrl>
<icon>icon.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © Cake Issues contributors</copyright>
<tags>cake cake-addin cake-issues cake-issueprovider linting codeclimate</tags>
<readme>docs\README.md</readme>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/5.6.1</releaseNotes>
<dependencies>
<group targetFramework="net8.0">
</group>
<group targetFramework="net9.0">
</group>
</dependencies>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
<file src="..\..\..\..\nuspec\nuget\Cake.Issues.CodeClimate.md" target="docs\README.md" />
<file src="Release\**\Cake.Issues.CodeClimate.*" target="lib" exclude="**\*.deps.json" />
</files>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Tests for the Cake.Issues.CodeClimate addin</Description>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Cake.Issues.CodeClimate\Cake.Issues.CodeClimate.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Testfiles\**\*" />
</ItemGroup>
</Project>
Loading
Loading