Skip to content

Commit

Permalink
improve render of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Dec 4, 2024
1 parent 3e67b35 commit cbe17bb
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions docs/converter/ecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ composer require --dev symplify/easy-coding-standard bartlett/sarif-php-converte
> (see e.g: [add junit output formatter](https://github.com/easy-coding-standard/easy-coding-standard/pull/212)),
> we have no other alternative that using the **Console Tool** convert command.
**Step 1:** Create a basic ECS config file
### :material-numeric-1-box: Create a basic ECS config file

For example :

Expand Down Expand Up @@ -75,7 +75,7 @@ return ECSConfig::configure()
;
```

**Step 2:** Build the native checkstyle output report
### :material-numeric-2-box: Build the native checkstyle output report

```shell
vendor/bin/ecs check --output-format=checkstyle > examples/ecs/checkstyle.xml
Expand All @@ -93,7 +93,7 @@ vendor/bin/ecs check --output-format=checkstyle > examples/ecs/checkstyle.xml
> return ECSConfig::configure()->withRealPathReporting(true);
> ```
**Step 3:** And finally, convert it to SARIF with the **Console Tool**
### :material-numeric-3-box: And finally, convert it to SARIF with the **Console Tool**
```shell
php report-converter convert ecs --input-format=checkstyle --input-file=examples/ecs/checkstyle.xml -v
Expand Down
4 changes: 2 additions & 2 deletions docs/converter/phan.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ composer require --dev phan/phan bartlett/sarif-php-converters
> As Phan v5 is not able to specify custom printer format,
> we have no other alternative that using the **Console Tool** convert command.
**Step 1:** Build the checkstyle output report
### :material-numeric-1-box: Build the checkstyle output report

```shell
vendor/bin/phpan --directory /absolute/path/to/source/code --absolute-path-issue-messages --output-mode=checkstyle --output=checkstyle.xml
Expand All @@ -47,7 +47,7 @@ vendor/bin/phpan --directory /absolute/path/to/source/code --absolute-path-issue
> Be sure to specify `--absolute-path-issue-messages`, otherwise the Console Tool `convert` command
> will raise some warnings about file names.
**Step 2:** And finally, convert it to SARIF with the **Console Tool**
### :material-numeric-2-box: And finally, convert it to SARIF with the **Console Tool**

```shell
php report-converter convert phan --input-format=checkstyle --input-file=examples/phan/checkstyle.xml -v
Expand Down
4 changes: 2 additions & 2 deletions docs/converter/phpcs-fixer.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ composer require --dev php-cs-fixer/php-cs-fixer bartlett/sarif-php-converters
> As PHP-CS-Fixer is not able to register custom reporter,
> we have no other alternative that using the **Console Tool** convert command.
**Step 1:** Build the native checkstyle output report
### :material-numeric-1-box: Build the native checkstyle output report

```shell
vendor/bin/php-cs-fixer fix --dry-run --format checkstyle /path/to/source/code > checkstyle.xml
Expand All @@ -47,7 +47,7 @@ vendor/bin/php-cs-fixer fix --dry-run --format checkstyle /path/to/source/code >
> Be sure to specify absolute path to source code to analyze, otherwise the Console Tool `convert` command
> will raise some warnings about file names.
**Step 2:** And finally, convert it to SARIF with the **Console Tool**
### :material-numeric-2-box: And finally, convert it to SARIF with the **Console Tool**

```shell
php report-converter convert phpcs-fixer --input-format=checkstyle --input-file=examples/phpcs-fixer/checkstyle.xml -v
Expand Down
8 changes: 4 additions & 4 deletions docs/converter/phpcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To make your report human-readable, you have to specify the `\JSON_PRETTY_PRINT`
Here is the way to do it !
**Step 1:** Create your report specialized class :
#### :material-numeric-1-box: Create your report specialized class
```php
namespace MyStandard\CS;
Expand All @@ -80,7 +80,7 @@ class MyPhpCsReport extends PhpCsReport
}
```
**Step 2:** And finally, print the SARIF report
#### :material-numeric-2-box: And finally, print the SARIF report

```shell
vendor/bin/phpcs --report=MyPhpCsReport --standard=examples/phpcs/.phpcs.xml.dist
Expand All @@ -90,13 +90,13 @@ vendor/bin/phpcs --report=MyPhpCsReport --standard=examples/phpcs/.phpcs.xml.dis

If you prefer to convert from a [format supported natively][phpcs-reporting] by PHPCS, then :

**Step 1:** Build the native [checkstyle output][phpcs-checkstyle-output] report
#### :material-numeric-1-box: Build the native [checkstyle output][phpcs-checkstyle-output] report

```shell
vendor/bin/phpcs --report=checkstyle --report-file=checkstyle.xml /path/to/source/code
```

**Step 2:** And finally, convert it to SARIF with the **Console Tool**
#### :material-numeric-2-box: And finally, convert it to SARIF with the **Console Tool**

```shell
report-converter convert phpcs --input-format=checkstyle --input-file=examples/phpcs/checkstyle.xml -v
Expand Down
6 changes: 3 additions & 3 deletions docs/converter/phplint.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Here is the way to do it !
>
> * Without verbose option (`-v`) the PHPLint `SarifOutput` will print a compact SARIF version.
**Step 1:** Prints the SARIF report
#### :material-numeric-1-box: Prints the SARIF report
```shell
vendor/bin/phplint --format='\Overtrue\PHPLint\Output\SarifOutput' --bootstrap vendor/autoload.php --output=examples/phplint/.sarif.json -v /path/to/source/code
Expand All @@ -78,13 +78,13 @@ vendor/bin/phplint --format='\Overtrue\PHPLint\Output\SarifOutput' --bootstrap v

If you prefer to convert from a format supported natively by PHPLint, then :

**Step 1:** Build the native checkstyle output report
#### :material-numeric-1-box: Build the native checkstyle output report

```shell
vendor/bin/phplint --format=checkstyle --output=checkstyle.xml /path/to/source/code
```

**Step 2:** And finally, convert it to SARIF with the **Console Tool**
#### :material-numeric-2-box: And finally, convert it to SARIF with the **Console Tool**

```shell
php report-converter convert phplint --input-format=checkstyle --input-file=examples/phplint/checkstyle.xml -v
Expand Down
6 changes: 3 additions & 3 deletions docs/converter/phpmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ composer require --dev phpmd/phpmd bartlett/sarif-php-converters
> As PHMMD v2.15 is not able to specify/boot custom renderer easily,
> we have no other alternative that using the **Console Tool** convert command.
**Step 1:** Build the checkstyle output report
### :material-numeric-1-box: Build the checkstyle output report

```shell
vendor/bin/phpmd /path/to/source checkstyle ruleset --report-file=checkstyle.xml
```

**Step 2:** And finally, convert it to SARIF with the **Console Tool**
### :material-numeric-2-box: And finally, convert it to SARIF with the **Console Tool**

```shell
php report-converter convert phpmd --input-format=checkstyle --input-file=examples/phpmd/checkstyle.xml -v
Expand All @@ -74,7 +74,7 @@ Alternative usage
>
> When PHPMD 3.0 will be [GA][general-availability], you can use this alternative
**Step 1:** Build the sarif output report directly via the default `Bartlett\Sarif\Converter\Reporter\PhpMdRenderer`
### :material-numeric-3-box: Build the sarif output report directly via the default `Bartlett\Sarif\Converter\Reporter\PhpMdRenderer`

```shell
vendor/bin/phpmd /path/to/source '\Bartlett\Sarif\Converter\Reporter\PhpMdRenderer' ruleset --bootstrap vendor/autoload.php --report-file=sarif.json
Expand Down
8 changes: 4 additions & 4 deletions docs/converter/phpstan.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To make your report human-readable, you have to specify the `\JSON_PRETTY_PRINT`

Here is the way to do it !

**Step 1:** Create your formatter specialized class :
#### :material-numeric-1-box: Create your formatter specialized class

```php
<?php
Expand All @@ -77,15 +77,15 @@ class MySarifFormatter extends PhpStanFormatter
}
```

**Step 2:** Create your own class loader to register custom serializer and converter (if any)
#### :material-numeric-2-box: Create your own class loader to register custom serializer and converter (if any)

```php
<?php
require_once dirname(__DIR__, 2) . '/vendor/autoload.php';
require_once __DIR__ . '/MySarifFormatter.php';
```

**Step 3:** Then update your `phpstan.neon` configuration file:
#### :material-numeric-3-box: Then update your `phpstan.neon` configuration file

```yaml
services:
Expand All @@ -95,7 +95,7 @@ services:
prettyPrint: true
```
**Step 4:** And finally, print the SARIF report
### :material-numeric-4-box: And finally, print the SARIF report
```shell
vendor/bin/phpstan analyse --error-format sarif --configuration phpstan.neon --autoload-file bootstrap.php
Expand Down
6 changes: 3 additions & 3 deletions docs/converter/psalm.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ composer require --dev vimeo/psalm bartlett/sarif-php-converters
> As Psalm v5 is not able to specify/boot custom renderer easily,
> we have no other alternative that using the **Console Tool** convert command.
**Step 1:** Initialize Psalm configuration file `psalm.xml`
### :material-numeric-1-box: Initialize Psalm configuration file `psalm.xml`

```shell
vendor/bin/psalm path/to/source --init
Expand All @@ -65,13 +65,13 @@ vendor/bin/psalm path/to/source --init
> Be sure to specify absolute path reporting (`absolutePathReporting="true"`) into `psalm.xml` config file,
> otherwise the Console Tool `convert` command will raise some warnings about file names.
**Step 2:** Build the checkstyle output report
### :material-numeric-2-box: Build the checkstyle output report

```shell
vendor/bin/psalm --report=psalm.checkstyle.xml
```

**Step 3:** And finally, convert it to SARIF normalized with the **Console Tool**
### :material-numeric-3-box: And finally, convert it to SARIF normalized with the **Console Tool**

```shell
php report-converter convert psalm --input-format=checkstyle --input-file=examples/psalm/psalm.checkstyle.xml -v
Expand Down
4 changes: 2 additions & 2 deletions docs/converter/rector.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ composer require --dev rector/rector bartlett/sarif-php-converters

## Usage

**Step 1:** Update your `rector.php` configuration file
### :material-numeric-1-box: Update your `rector.php` configuration file

Register at least the `RectorFormatter` service to be able to specify `--output-format sarif` with rector command.

Expand All @@ -53,7 +53,7 @@ return RectorConfig::configure()
;
```

**Step 2:** Then print the SARIF report
### :material-numeric-2-box: Then print the SARIF report

```shell
vendor/bin/rector process --dry-run --output-format sarif --config /path/to/rector.php > .sarif.json
Expand Down
8 changes: 4 additions & 4 deletions docs/converter/twigcs-fixer.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To make your report human-readable, you have to specify the `\JSON_PRETTY_PRINT`
Here is the way to do it !
**Step 1:** Create your report specialized class :
#### :material-numeric-1-box: Create your report specialized class
```php
<?php
Expand All @@ -82,7 +82,7 @@ class MyTwigCsFixerReporter extends TwigCsFixerReporter
}
```
**Step 2:** And finally, print the SARIF report
#### :material-numeric-2-box: And finally, print the SARIF report

```shell
vendor/bin/twig-cs-fixer lint /path/to/source --report sarif --config .twig-cs-fixer.php
Expand All @@ -96,13 +96,13 @@ vendor/bin/twig-cs-fixer lint /path/to/source --report sarif --config .twig-cs-f

If you prefer to convert from a [format supported natively][[twigcs-fixer-custom-reporters]] by Twig-CS-Fixer, then :

**Step 1:** Build the checkstyle output report
#### :material-numeric-1-box: Build the checkstyle output report

```shell
vendor/bin/twig-cs-fixer lint /path/to/source --report checkstyle
```

**Step 2:** And finally, convert it to SARIF with the **Console Tool**
#### :material-numeric-2-box: And finally, convert it to SARIF with the **Console Tool**

```shell
php report-converter convert twigcs-fixer --input-format=checkstyle --input-file=examples/twigcs-fixer/checkstyle.xml -v
Expand Down

0 comments on commit cbe17bb

Please sign in to comment.