Skip to content

Commit

Permalink
Add SonarQube badge to PackageTest and README
Browse files Browse the repository at this point in the history
This commit includes the addition of a SonarQube badge in both the PackageTest and README files. The changes enhance the project's visibility of code quality metrics and updates README for better representation. A test function for the badge was also included in the PackageTest.
  • Loading branch information
SmetDenis committed Apr 10, 2024
1 parent 12f7ce5 commit bd4c25c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
[![CI](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml/badge.svg)](https://github.com/JBZoo/Csv-Blueprint/actions/workflows/demo.yml)
[![Coverage Status](https://coveralls.io/repos/github/JBZoo/Csv-Blueprint/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Csv-Blueprint?branch=master)
[![Psalm Coverage](https://shepherd.dev/github/JBZoo/Csv-Blueprint/coverage.svg)](https://shepherd.dev/github/JBZoo/Csv-Blueprint)
[![GitHub Release](https://img.shields.io/github/v/release/jbzoo/csv-blueprint?label=Latest)](https://github.com/jbzoo/csv-blueprint/releases)
[![Total Downloads](https://poser.pugx.org/jbzoo/csv-blueprint/downloads)](https://packagist.org/packages/jbzoo/csv-blueprint/stats)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=JBZoo_Csv-Blueprint&metric=alert_status)](https://sonarcloud.io/summary/overall?id=JBZoo_Csv-Blueprint)
[![Docker Pulls](https://img.shields.io/docker/pulls/jbzoo/csv-blueprint.svg)](https://hub.docker.com/r/jbzoo/csv-blueprint/tags)
[![GitHub Release](https://img.shields.io/github/v/release/jbzoo/csv-blueprint?label=Latest)](https://github.com/jbzoo/csv-blueprint/releases)
<!-- auto-update:/top-badges -->

<!-- auto-update:rules-counter -->
Expand Down
17 changes: 15 additions & 2 deletions tests/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,18 @@ final class PackageTest extends \JBZoo\Codestyle\PHPUnit\AbstractPackageTest
'sonarcloud' => true,
'coveralls' => true,
'circle_ci' => true,
'sonar_qube' => true,
];

protected array $badgesTemplate = [
'github_actions',
'github_actions_demo',
'coveralls',
'psalm_coverage',
'github_latest_release',
'packagist_downloads_total',
'sonar_qube',
//'packagist_downloads_total',
'docker_pulls',
'github_latest_release',
];

protected function setUp(): void
Expand Down Expand Up @@ -175,6 +177,17 @@ protected function checkBadgeGithubLatestRelease(): ?string
);
}

protected function checkBadgeSonarQube(): ?string
{
return $this->getPreparedBadge(
$this->getBadge(
'Quality Gate Status',
'https://sonarcloud.io/api/project_badges/measure?project=JBZoo_Csv-Blueprint&metric=alert_status',
'https://sonarcloud.io/summary/overall?id=JBZoo_Csv-Blueprint',
),
);
}

protected function getTitle(): string
{
return '# JBZoo / CSV Blueprint';
Expand Down

0 comments on commit bd4c25c

Please sign in to comment.