beechit / json-to-code-climate-subset-converter

CLI tool that'll convert supported JSON files to a subset of the Code Climate JSON format
19 stars 6 forks source link

Allow symfony/console 6 #44

Open tvbeek opened 2 years ago

tvbeek commented 2 years ago

I'm updating a Laravel package and Laravel 9 use Symfony 6. Currently it isn't possible to use that in combination with this package.

The Changelog for symfony/console 6 is: https://github.com/symfony/console/blob/6.0/CHANGELOG.md

I currently didn't yet have the time to create a PR and test it. I hope to find some time in the future but thought it was a good idea to create an issue.

tvbeek commented 2 years ago

First check for packages that result in work to allow version 6:

jelovac commented 2 years ago

Hi @tvbeek,

Since this package is a tool (binary) and not a direct code dependency in terms you need it to run your code I think it is wrong to put this package as dependency in your main project composer.json. Instead you should create another composer.json under some directory and install the package there. That way you are not dependent on your project dependencies.

This also suggested by the PHP-CS-Fixer: https://github.com/FriendsOfPHP/PHP-CS-Fixer#installation

Here is an example how I would do it:

"scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts",
            "[ $COMPOSER_DEV_MODE -eq 0 ] || composer run install-dev-tools"
        ],
        "post-update-cmd": [
            "@auto-scripts",
            "[ $COMPOSER_DEV_MODE -eq 0 ] || composer run update-dev-tools"
        ],
        "install-dev-tools": [
            "@php composer install --working-dir tools/php-cs-fixer",
            "@php composer install --working-dir tools/gitlab-code-quality-converter"
        ],
        "update-dev-tools": [
            "@php composer update --working-dir tools/php-cs-fixer",
            "@php composer update --working-dir tools/gitlab-code-quality-converter"
        ],
        "code-lint": [
            "@php tools/php-cs-fixer/vendor/bin/php-cs-fixer fix -vvv --show-progress=dots"
        ],
    },

Then in your tools/gitlab-code-quality-converter/composer.json you would have like this:

{
  "require": {
    "php": ">=8.0", // Needs to match the PHP version in your project composer.json if you intend to run the tool from the same php environment
    "beechit/json-to-code-climate-subset-converter": "^1.6"
  }
}

Since this tool is mostly needed to solve GitLab multiple Code Quality reports limitation you might just run the tool from a Docker image and keep your project code free of it.

asanikovich commented 1 year ago

Any news?

ttomdewit commented 1 year ago

Any news?

Not at the moment, I'll find some time this week to clean up open issues and PRs. No promise or commitment, but I'll do what I can.

asanikovich commented 1 year ago

Since this package is a tool (binary) and not a direct code dependency in terms you need it to run your code I think it is wrong to put this package as dependency in your main project composer.json. Instead you should create another composer.json under some directory and install the package there. That way you are not dependent on your project dependencies.

it helps me to install under another directory