Skip to content

Commit

Permalink
Fix YAML file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-tech committed Oct 8, 2023
1 parent e38e94a commit 2e0eb6e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pdepend Summary Formatter is a tool to show software code quality metrics, measured by
[PHP Depend](https://github.com/pdepend/pdepend) (pdepend),
in console for development and in CI/CD.
in console for development and in CI/CD pipeline.

## Table of contents
<!-- MarkdownTOC levels="1,2,3,4,5,6" autoanchor="true" autolink="true" -->
Expand All @@ -35,7 +35,7 @@ composer require --dev pdepend/pdepend:"^2.15"
composer require --dev andrey-tech/pdepend-summary-formatter-php
```

Generate a default config file `pdepend-summary-formatter.yaml.dist` in current working directory:
Generate a default config file `pdepend-summary-formatter.yml.dist` in current working directory:

```shell
./vendor/bin/pdepend-summary-formatter --init
Expand Down Expand Up @@ -63,7 +63,7 @@ measured by PHP Depend, in console and write results to specified text file `sum

The command line interface also accepts the following optional arguments:

- `--init` - Will generate a default config file `pdepend-summary-formatter.yaml.dist` in current working directory.
- `--init` - Will generate a default config file `pdepend-summary-formatter.yml.dist` in current working directory.
- `--output-file=` - Write results also to the specified text file.
- `--config-file=` - The filepath to a custom config YAML file.
- `--no-colors` - Disable colors in console.
Expand All @@ -72,10 +72,10 @@ An example command line of Pdepend Summary Formatter tool and PHP Depend tool:

```shell
./vendor/bin/pdepend --summary-xml=./var/summary.xml --suffix=php src,tests
./vendor/bin/pdepend-summary-formatter ./var/summary.xml --config-file=./pdepend-sf.yaml --output-file=./var/summary.txt
./vendor/bin/pdepend-summary-formatter ./var/summary.xml --config-file=./pdepend-summary-formatter.yml --output-file=./var/summary.txt
```

An example of output file `summary.txt`:
An example of output text file `summary.txt`:

```text
FILE: src/AndreyTech/Pdepend/Summary/Formatter/Colorizer.php
Expand Down Expand Up @@ -112,12 +112,14 @@ from a given code base, these values can be used to measure the quality of a sof
and they help to identify that parts of an application where a refactoring should be applied.

Pdepend Summary Formatter tool shows only part of software metrics, measured by PHP Depend,
and colors them (green, yellow, red) in the console according to boundaries for values,
established in configuration YAML file.
and colors them
(<span style="color: green">green</span>, <span style="color: yellow">yellow</span>, <span style="color: red">red</span>)
in the console according to boundaries for values, defined in configuration YAML file.

This table give a list of the software metrics, shows by Depend Summary Formatter tool
This table give a list of the software metrics, shows by Pdepend Summary Formatter tool
for entire project, classes, traits, methods,
and default values for red boundaries, based on [PHP Mess Detector](https://phpmd.org/) (PHPMD) tool.
and default values for <span style="color: red">red</span> boundaries of software metrics,
based on [PHP Mess Detector](https://phpmd.org/) (PHPMD) tool.

| Metric | Description | Project | Class | Trait | Method |
|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-------|-------|--------|
Expand Down Expand Up @@ -161,22 +163,22 @@ Note: ✓ - means there are no defined color boundaries for this metric.
## Configuration YAML file

By default Pdepend Summary Formatter search following configuration YAML files is current working directory:
- `pdepend-summary-formatter.yaml`,
- `pdepend-summary-formatter.yaml.dist`.
- `pdepend-summary-formatter.yml`,
- `pdepend-summary-formatter.yml.dist`.

Configuration YAML file allow to set color boundaries for values of software metrics.

Pdepend Summary Formatter tool currently defines three color boundaries:

| Color | Description |
|----------|-------------|
| `green` | Ok |
| `yellow` | Warning |
| `red` | Error |
| Color | Description |
|-------------------------------------------|-------------|
| <span style="color: green">green</span> | Ok |
| <span style="color: yellow">yellow</span> | Warning |
| <span style="color: red">red</span> | Error |

A white value means there are no defined color boundaries for this metric.

> You can also add/set custom colors and options.
> You can also add/set custom colors and styles.
> See [How to Color and Style the Console Output](https://symfony.com/doc/current/console/coloring.html) in Symfony console.
Fragment of default configuration file:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "andrey-tech/pdepend-summary-formatter-php",
"description": "Tool to show software code quality metrics, measured by PHP Depend, in console and CI/CD",
"description": "Tool to show software code quality metrics, measured by PHP Depend, in console and CI/CD pipeline",
"keywords": [
"dev",
"pdepend",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/AndreyTech/Pdepend/Summary/Formatter/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

final class Config
{
private const CONFIG_FILE = 'pdepend-summary-formatter.yaml';
private const CONFIG_FILE_DIST = 'pdepend-summary-formatter.yaml.dist';
private const CONFIG_FILE = 'pdepend-summary-formatter.yml';
private const CONFIG_FILE_DIST = 'pdepend-summary-formatter.yml.dist';
private const CONFIG_DIR = __DIR__ . '/../../../../../config';

private ConsoleOutput $consoleOutput;
Expand Down

0 comments on commit 2e0eb6e

Please sign in to comment.