GithubHelp home page GithubHelp logo

toolbox's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

toolbox's Issues

Rector latest version unlock

Rector is currently locked to a previous version because of a bug.
#309

It looks as though this bug is now sorted. Additionally, I'm getting a weird issue running rector from the latest phpqa which I'm hoping will be fixed by using the latest rector which is now on version 0.9.x (the bug it was locked against was in 0.8.x).

The error I'm getting is

Fatal error: Uncaught _HumbugBox9a2b3b20a128\Nette\InvalidArgumentException: Service '0190': Class or interface 'PHPStan\Type\Doctrine\DescriptorRegistry' not found. in phar:///tools/.composer/vendor-bin/rector/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/Definition.php:52
Stack trace:
#0 phar:///tools/.composer/vendor-bin/rector/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Definitions/ServiceDefinition.php(46): _HumbugBox9a2b3b20a128\Nette\DI\Definitions\Definition->setType('PHPStan\\Type\\Do...')
#1 phar:///tools/.composer/vendor-bin/rector/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(67): _HumbugBox9a2b3b20a128\Nette\DI\Definitions\ServiceDefinition->setType('PHPStan\\Type\\Do...')
#2 phar:///tools/.composer/vendor-bin/rector/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php(51): _HumbugBox9a2b3b20a128\Nette\DI\Extensions\ServicesExtension->updateServiceDefinition(Object(_HumbugBox9a2b3b2 in phar:///tools/.composer/vendor-bin/rector/vendor/rector/rector-prefixed/rector/vendor/nette/di/src/DI/Extensions/ServicesExtension.php on line 54

Thanks

[DX] Tools curation

Moved from jakzal/phpqa#92

Since the added value with this image is the selection and discovery of actually valuable PHP related QA and similar tools (which you might not know about), it might make sense to make that more prominent.

  1. For example, there are tools which don't seem to work:
$ phpqa churn run

Fatal error: Uncaught TypeError: Argument 1 passed to Symfony\Component\Yaml\Yaml::parse() must be of the type string, boolean given, called in /tools/.composer/vendor-bin/tools/vendor/bmitch/churn-php/src/Commands/ChurnCommand.php on line 81 and defined in /tools/.composer/vendor-bin/tools/vendor/symfony/yaml/Yaml.php:76
  1. There are also tools which were added, but in the meantime a better candidate for the same task appeared, example phpca vs. ComposerRequireChecker
  2. some tools might be obsoleted upstream in the meantime

What I propose is this:

  1. introduce a way to mark tools as broken or deprecated (with optional suggestion for an alternative)
  2. introduce a way to tag tools (with tags such as composer, util, analysis, style, test, phpstan, etc).
  3. introduce a way to list tools by tag, example phpqa list style
  4. introduce a way to provide a short help about the tool, example phpqa info phpstan-doctrine would explain how to enable it, with even a short example
  5. have a bit of a nicer CLI for the listing (can we use Symfony Console here?)

It would probably be best if we separated tools out ftom the JSON into something else to make it more maintainable in te future.

Overall, I think this project might gain some traction as other projects start using it for their CI more so it would benefit from these kind of small tweaks which raise the value quite a bit.

WDYT?

Check the tools with `exclude-php:8.0` tag

There are 16 tools with exclude-php:8.0 tag.

Each repo has been checked, to create this plan

Name Excluded from PHP 8.0 Comments Worth a Try?
analyze Last PR 4 Dec 2019. Forked project also has no recent activity
box Add PHP 8 support (#508)
diffFilter Last PR Oct 2020, composer.json shows "php": ">=7.0",
doctrine-psalm-plugin composer.json showing "php": ".. ^8",
parallel-lint README updated 15 Mar 2020 to advise This repository is abandoned. Suggested alternative: https://github.com/php-parallel-lint/PHP-Parallel-Lint > readme states This works from PHP 5.4 to 7.4
paratest Last PR 5 days ago, composer.json "php": " .. ^8.0",
php-coupling-detector Last PR 4 Jan 2021 to add PHP 8 #62, composer.json "php": ">=7.2",
php-formatter Last PR 31 Dec 2017.
phpat Last PR 28 Dec 2020. composer.json "php": "^7.2",
phpDocumentor Last PR 22 Feb 2021 (Yesterday). composer.json "php": "... ^8.0",
phpinsights Last PR 9 days ago (14 Feb 2021) composer.json "php": ".. ^8.0",
phpmnd Last PR 27 days ago (25 Jan 2021) composer.json "php": "^7.1",
phpunit-5 Last PR for 5.7.27 was 1 Feb 2018
phpunit-7 composer.json for 7.5.20 locked at "php": "^7.1",, a fork used by Silverstripe may work: sminnee/phpunit
rector Last PR today 23 Feb 2021. php: .. ^8.0
roave-backward-compatibility-check Last PR 5 days ago (18 Feb 2021), composer.json "php": "^7.4.7",

Summary

  • ✅ 7 worth a try
  • ❌ 8 no activity or locked to PHP 7
  • ❓ 1 is possible by using a fork.

The next step is to remove the tag and see if the build passes.

Edit: php-formatter should be ❌

phive fails to install phpbench

https://github.com/jakzal/toolbox/runs/2339677014?check_suite_focus=true#step:5:350

Phive 0.14.5 - Copyright (C) 2015-2021 by Arne Blankerts, Sebastian Heuer and Contributors
Downloading https://github.com/phpbench/phpbench/releases/download/1.0.0-beta1/phpbench.phar
Downloading https://github.com/phpbench/phpbench/releases/download/1.0.0-beta1/phpbench.phar.asc
Downloading key 15E1F8E2B149E6F5
Trying to connect to keys.openpgp.org (37.218.245.50)
Downloading https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x15E1F8E2B149E6F5
Successfully downloaded key.
Warning:  Parsing key data failed with error code 0: No UIDs in key found
Trying to connect to keyserver.ubuntu.com (162.213.33.9)
Trying to connect to keyserver.ubuntu.com (162.213.33.8)
Warning:  Failed with error code 404: Key not found on keyserver
Trying to connect to hkps.pool.sks-keyservers.net (209.244.105.201)
Warning:  Failed with error code 404: Key not found on keyserver
Error:    PublicKey 15E1F8E2B149E6F5 not found on key servers

/cc @mihai-stancu @dantleech

Error installing php-semver-checker

When trying toolbox install I get the following error:

The command '/bin/sh -c php $TOOLBOX_TARGET_DIR/toolbox install' returned a non-zero code: 6

The problem seems to be related to unavailability of http://psvc.coreteks.org where php-semver-checker.phar is fetched. Trying to get it manually I get the following error:

wget http://psvc.coreteks.org/php-semver-checker.phar -O /dev/null 
--2019-05-05 21:46:43--  http://psvc.coreteks.org/php-semver-checker.phar
Resolving psvc.coreteks.org (psvc.coreteks.org)... failed: Name or service not known.
wget: unable to resolve host address ‘psvc.coreteks.org’

It appears that the problem that happened to pdepend also hit php-semver-checker (but this doesn't even dns resolve).

Tag all the tools

  1. Come up with a list of tags we'd like to introduce (share suggestions in comments).
  2. Tag the tools.

Get PHPCP on PHP 7.2

I will mad a pull request soon, but i think we can do this now, in order to get phpcdp on php 7.2 images :


    {
      "name": "phpcpd",
      "summary": "Copy/Paste Detector",
      "website": "https://github.com/sebastianbergmann/phpcpd",
      "command": {
        "phar-download": {
          "phar": "https://phar.phpunit.de/phpcpd-4.1.0.phar",
          "bin": "%target-dir%/phpcpd"
        }
      },
      "test": "phpcpd -V",
      "tags": ["featured", "exclude-php:7.3, "exclude-php:7.4"]
    },

Add support to strip (minimize in size) the install dir

When pushing into a Docker image, you want the final installed size to be minimal.

We could, for example, add a flag --strip which would, after finishing installation, remove:

  • .git folders
  • test/, tests/ etc
  • doc/

We could even inspect .gitattributes file and remove files suppressed for addition if we're pulling a git repo.

Cannot run with composer docker image

I have existing symfony project wanted to give it a try with latest composer image:

docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp composer:latest bash
bash-5.1# php -v
PHP 8.0.6 (cli) (built: May 7 2021 20:48:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.6, Copyright (c) Zend Technologies
bash-5.1# curl -s https://api.github.com/repos/jakzal/toolbox/releases/latest
| grep "browser_download_url.*toolbox.phar"
| cut -d '"' -f 4
| xargs curl -Ls -o toolbox
&& chmod +x toolbox
bash-5.1# ./toolbox install
You are already using the latest available Composer version 2.1.1 (stable channel).
/usr/local/bin/phive
Changed current directory to /tmp
You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.
Using version ^1.4 for bamarni/composer-bin-plugin
./composer.json has been updated
Running composer update bamarni/composer-bin-plugin
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file
Nothing to install, update or remove
Generating autoload files
Changed current directory to /tmp
Phive 0.14.5 - Copyright (C) 2015-2021 by Arne Blankerts, Sebastian Heuer and Contributors
[ERROR] No executable gpg binary found.
[ERROR] Either install gpg or enable the gnupg extension in PHP.

Drop dunglas/phpdoc-to-typehint

The repository has been archived and is no longer maintained:

Archived! This repository is now archived. Consider using PHP CS Fixer (and especially the phpdoc_to_param_type and phpdoc_to_return_type rules) or Rector instead.

Split tools.json into smaller groups of tools

In order to make maintenance easier, tools.json should be split into smaller files according to tools the type. Some tools that we provide plugins for (like phpstan) could possibly get its own file.

Relative symlinks in TOOLS_TARGET_DIR

Hi,

I was trying to build an image based on yours using docker multi-stage builds. I wanted to move the tools from /tools to somewhere else but their symlinks are full paths and moving them would break the links.

Did you use a full path approach because various tools aren't giving you enough control over the exact symlink?

PHPStan Larastan extension causes conflict with installed Symfony installation

As per the discussion here #338 - having the Larastan PHPStan extension as part of the phpqa package causes PHPStan to report errors that are not part of the codebase being analysed.

Is it possible for me to build a customised phpqa which does not have the larastan extension? I see the instructions on how to make a custom docker build but I guess in this case I need to modify what's coming from the toolbox repo? Or would it just be a case of using the composer-bin-plugin to remove the larastan extension?

php-cs-fixer: not found

Docker image: jakzal/phpqa:latest
Cmd line:

docker pull jakzal/phpqa:latest
docker run -v C:\xampp\htdocs\:/project -w /project --rm jakzal/phpqa:latest php-cs-fixer --diff --dry-run -v fix . 

Output: /entrypoint.sh: 6: exec: php-cs-fixer: not found

9 november 2020 all work fine

Scoping the tools

I wanted to contribute scoping of one of the tools that toolbox ships because there are scoping issues when running it in one of our projects. To do this, I expected some tools would already be scoped so I can get inspiration what modifications in tools.json file I need to make. But looking into this json file, I don't see any such configuration in existing tools. Does this mean toolbox currently does not do scoping of any of the current tools whatsoever?

Ref deprecated-packages/symplify#1872

PHPStan & Symfony version issue???

Using toolbox 1.39.0 and phpqa 1.49.0 on my Symfony 4.4.19 project.

At the end of every PHPStan analysis I get several errors like this.

Child process error (exit code 255): Warning: Declaration of                                                     
Symfony\Component\Translation\DependencyInjection\TranslatorPathsPass::processValue($value, bool $isRoot =       
false) should be compatible with                                                                                 
Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass::processValue($value, $isRoot = false) in   
/tools/.composer/vendor-bin/phpstan/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php on    
line 82                                                                                                          
Fatal error: Declaration of Symfony\Bridge\Monolog\Processor\DebugProcessor::getLogs() must be compatible with   
Symfony\Component\HttpKernel\Log\DebugLoggerInterface::getLogs(?Symfony\Component\HttpFoundation\Request         
$request = NULL) in /project/vendor/symfony/monolog-bridge/Processor/DebugProcessor.php on line 64 

It is complaining about a method signature mismatch between (I think!) my Symfony installation which is being analysed, and /tools/.composer/vendor-bin/phpstan/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php which appears to be a Symfony component as part of the PHPStan installation.

I can't find any existing issues here, on phpqa or phpstan repos. Can you shed any light on this?

If it's a PHPStan issue just let me know and I'll submit an issue over there. PHPStan has switched to a PHAR format and I think this means that in its standalone form this kind of issue shouldn't happen - hence me posting here first.

Thanks for any help.

Abandoned packages used

Package halleck45/phpmetrics is abandoned, you should avoid using it.
Use phpmetrics/phpmetrics instead.

Package edsonmedina/php_testability is abandoned, you should avoid using it.
No replacement was suggested.

Spotted in the build 👼

toolbox install behind a proxy

Hi,

I'm trying to build a custom phpqa docker image on a server behind a proxy but the command php toolbox install (I think but maybe I'm mistaken) fail with the following error :

Error: file_get_contents(https://box-project.github.io/box2/manifest.json): failed to open stream: Connection timed out

I bypassed the error by adding a php script with a stream context, and loaded the script with auto_prepend_file (php.ini) in the Dockerfile, but I don't think this is a long-term solution.

Regards,
Yannick

Symbol "~" in created symlinks from ComposerBinCommand

return \sprintf( 'ln -sf ${COMPOSER_HOME:-"~/.composer"}/vendor-bin/%s/vendor/bin/%s %s', $this->namespace, $this->source, $this->target );

This code results at unusable symlinks.

Please replace "~" with the content of HOME variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.