json-to-code-climate-subset-converter
2.5K
CLI tool that'll convert supported JSON files to a subset of the Code Climate JSON format. The output file code-climate.json can be used in GitLab CI to show degrations in merge requests via the report artifact. See GitLab Code Quality documentation for more information.
Please note this project is actively worked on but it's not ready for production use.
[
{
"type": "issue",
"type_id": 11007,
"check_name": "PhanUndeclaredClassConstant",
"description": "UndefError PhanUndeclaredClassConstant Reference to constant class from undeclared class \\PhpParser\\Node\\Stmt\\ClassMethod",
"severity": 10,
"location": {
"path": "app/Class.php",
"lines": {
"begin": 32,
"end": 34
}
}
}
]
[
{
"description": "(Phan) UndefError PhanUndeclaredClassConstant Reference to constant class from undeclared class \\PhpParser\\Node\\Stmt\\ClassMethod",
"fingerprint": "fd46675f22771e90045b745429e46682",
"location": {
"path": "app/Class.php",
"lines": {
"begin": 32,
"end": 34
}
}
}
]
By default, no driver is included in the run. You'll have to manually specify what drivers are to be included whilst converting.
For example, if you wish to run the converter with Psalm, you'll run:
php converter convert --psalm
The included converters are enabled via their respective flags:
php converter convert --phpstanphp converter convert --psalmphp converter convert --phanphp converter convert --phpcsphp converter convert --phplintIf you wish to specify the Psalm input file (JSON format), you'll run:
php converter convert --psalm --psalm-json-file=path/to/file.json
php converter convert --phpstan --phpstan-json-file=path/to/file.jsonphp converter convert --psalm --psalm-json-file=path/to/file.jsonphp converter convert --phan --phan-json-file=path/to/file.jsonphp converter convert --phpcs --phpcs-json-file=path/to/file.jsonphp converter convert --phplint --phplint-json-file=path/to/file.jsonIf you're working on a project that supports multiple tools, you're free to add as many supported drivers in your command.
php converter convert --phpstan --psalm --phpcs
docker build -t converter .
docker run --rm -t -v $(pwd):/project -w /project converter convert --phpstan
This will mount the current directory in the container under /project, and execute the converter.
This will also remove the container after use.
By default a code-climate.json file is generated for you to use.
Content type
Image
Digest
Size
28.1 MB
Last updated
over 6 years ago
docker pull hyperized/json-to-code-climate-subset-converter