{"id":13430163,"url":"https://github.com/lucaslorentz/minicover","last_synced_at":"2025-05-14T22:08:30.234Z","repository":{"id":19942352,"uuid":"88353157","full_name":"lucaslorentz/minicover","owner":"lucaslorentz","description":"Cross platform code coverage tool for .NET Core","archived":false,"fork":false,"pushed_at":"2025-01-16T09:23:00.000Z","size":719,"stargazers_count":212,"open_issues_count":6,"forks_count":39,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-12T08:19:35.498Z","etag":null,"topics":["code-coverage","coverage","dotnet","dotnet-cli","dotnet-core","net-core","netcore"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucaslorentz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-04-15T14:45:54.000Z","updated_at":"2025-01-16T09:22:38.000Z","dependencies_parsed_at":"2024-01-02T22:44:34.181Z","dependency_job_id":"3e1e44d3-5ea8-4156-b1c3-9a5e34911794","html_url":"https://github.com/lucaslorentz/minicover","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslorentz%2Fminicover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslorentz%2Fminicover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslorentz%2Fminicover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucaslorentz%2Fminicover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucaslorentz","download_url":"https://codeload.github.com/lucaslorentz/minicover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253763957,"owners_count":21960484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-coverage","coverage","dotnet","dotnet-cli","dotnet-core","net-core","netcore"],"created_at":"2024-07-31T02:00:50.657Z","updated_at":"2025-05-14T22:08:25.221Z","avatar_url":"https://github.com/lucaslorentz.png","language":"C#","funding_links":[],"categories":["Frameworks, Libraries and Tools","框架, 库和工具","Code Analysis and Metrics"],"sub_categories":["Code Analysis and Metrics","代码分析和指标"],"readme":"# MiniCover\nCode Coverage Tool for .NET Core\n\n[![Build Status](https://dev.azure.com/lucaslorentzlara/lucaslorentzlara/_apis/build/status/lucaslorentz.minicover?branchName=master)](https://dev.azure.com/lucaslorentzlara/lucaslorentzlara/_build/latest?definitionId=3\u0026branchName=master)\n[![Nuget](https://img.shields.io/nuget/v/minicover)](https://www.nuget.org/packages/MiniCover/)\n[![Coverage Status](https://coveralls.io/repos/github/lucaslorentz/minicover/badge.svg?branch=master)](https://coveralls.io/github/lucaslorentz/minicover?branch=master)\n\n## Supported .NET Core SDKs\n- 8.0 (Global tool or local tool)\n- 9.0 (Global tool or local tool)\n\n## Installation\nMiniCover can be installed as a global tool:\n```\ndotnet tool install --global minicover\n```\nOr local tool:\n```\ndotnet tool install minicover\n```\n\n## Commands\nThis is a simplified documentation of MiniCover commands and options.\n\nUse `--help` for more information:\n```\nminicover --help\n```\n\n**When installed as local tool, MiniCover commands must be prefixed with `dotnet`.** Example:\n```\ndotnet minicover --help\n```\n\n### Instrument\n```\nminicover instrument\n```\n\nUse this command to instrument assemblies to record code coverage.\n\nIt is based on the following main options:\n\n|option|description|type|default|\n|-|-|-|-|\n|**sources**|source files to track coverage|glob|`src/**/*.cs`|\n|**exclude-sources**|exceptions to source option|glob|`**/bin/**/*.cs` and `**/obj/**/*.cs`|\n|**tests**|test files used to recognize test methods|glob|`tests/**/*.cs` and `test/**/*.cs`|\n|**exclude-tests**|exceptions to tests option|glob|`**/bin/**/*.cs` and `**/obj/**/*.cs`|\n|**assemblies**|assemblies considered for instrumentation|glob|`**/*.dll`|\n|**exclude-assemblies**|Exceptions to assemblies option|glob|`**/obj/**/*.dll`|\n\n*Note 1: Assemblies not related to sources or tests are automatically ignored.*\n\n*Note 2: [Supported syntax](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.filesystemglobbing.matcher?view=dotnet-plat-ext-3.0#remarks) for glob values.*\n\n*Note 3: You can repeat glob options to represent multiple values. Example: `--sources \"a/**/*.cs\" --sources \"b/**/*.cs\"`*\n\nThis command also generates a **coverage.json** file with information about the instrumented code.   \n\n### Uninstrument\n```\nminicover uninstrument\n````\n\nUse this command to revert the instrumentation based on **coverage.json** file.\n\n**Make sure you call uninstrument before publishing or packing your application.**\n\n### Reset\n```\nminicover reset\n````\n\nUse this command to reset the recorded coverage so far.\n\n### Report\n```\nminicover report\n````\n\nUse this command to print a coverage report in the console.\n\nThe command exits with failure if the coverage doesn't meet a specific threshold (90% by default).\n\n### More commands\n\n- **cloverreport**: Write an Clover-formatted XML report to file\n- **coberturareport**: Write a cobertura XML report to file\n- **coverallsreport**: Prepare and/or submit coveralls reports\n- **htmlreport**: Write html report to folder\n- **opencoverreport**: Write an OpenCover-formatted XML report to file\n- **xmlreport**: Write an NCover-formatted XML report to file\n\nUse `--help` for more information.\n\n## Build script example\n```shell\ndotnet restore\ndotnet build\n\n# Instrument\nminicover instrument\n\n# Reset hits\nminicover reset\n\ndotnet test --no-build\n\n# Uninstrument\nminicover uninstrument\n\n# Create html reports inside folder coverage-html\nminicover htmlreport --threshold 90\n\n# Console report\nminicover report --threshold 90\n```\n\n## Ignore coverage files\n\nAdd the following to your .gitignore file to ignore code coverage results:\n```\ncoverage-html\ncoverage-hits\ncoverage.json\n```\n\n## Libraries\n\nWhen using MiniCover libraries:\n\n- use dependency injection to create instances\n- use only the main interfaces listed on each package below\n\nBy doing that, you reduce the risk of being impacted by future MiniCover changes.\n\n### MiniCover.Core\n\nMain MiniCover operations.\n\nDependency injection configuration:\n```C#\nservices.AddMiniCoverCore();\n```\n\nMain interfaces:\n- IInstrumenter\n- IUninstrumenter\n- IHitsReader\n- IHitsResetter\n\n### MiniCover.Reports\n\nMiniCover reports.\n\nDependency injection configuration:\n```C#\nservices.AddMiniCoverCore();\nservices.AddMiniCoverReports();\n```\n\nMain interfaces:\n- ICloverReport\n- ICoberturaReport\n- IConsoleReport\n- ICoverallsReport\n- IHtmlReport\n- IHtmlSourceFileReport\n- INCoverReport\n- IOpenCoverReport\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaslorentz%2Fminicover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucaslorentz%2Fminicover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucaslorentz%2Fminicover/lists"}