Code Monkey home page Code Monkey logo

devtools's People

Contributors

hywan avatar metalaka avatar pierozi avatar shulard avatar vonglasow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devtools's Issues

issue on cs fixer

when I install php-cs-fixer globaly, I go errors
php-cs-fixer --version
PHP CS Fixer 2.3.1 by Fabien Potencier and Dariusz Ruminski (d5257f7)

$ vendor/bin/hoa devtools:cs --dry-run --diff .
PHP Fatal error: Cannot override final method PhpCsFixer\AbstractFixer::fix() in /home/jvb/workspace/_perso/hoa/File/vendor/hoa/devtools/Resource/PHPCSFixer/Fixer/Author.php on line 92
PHP Stack trace:
PHP 1. {main}() /home/jvb/bin/bin/php-cs-fixer:0
PHP 2. Symfony\Component\Console\Application->run() /home/jvb/bin/bin/php-cs-fixer:47
PHP 3. Symfony\Component\Console\Application->doRun() phar:///home/jvb/bin/bin/php-cs-fixer/vendor/symfony/console/Application.php:121
PHP 4. Symfony\Component\Console\Application->doRunCommand() phar:///home/jvb/bin/bin/php-cs-fixer/vendor/symfony/console/Application.php:190
PHP 5. Symfony\Component\Console\Command\Command->run() phar:///home/jvb/bin/bin/php-cs-fixer/vendor/symfony/console/Application.php:826
PHP 6. PhpCsFixer\Console\Command\FixCommand->execute() phar:///home/jvb/bin/bin/php-cs-fixer/vendor/symfony/console/Command/Command.php:262
PHP 7. PhpCsFixer\Console\ConfigurationResolver->getReporter() phar:///home/jvb/bin/bin/php-cs-fixer/src/Console/Command/FixCommand.php:144
PHP 8. PhpCsFixer\Console\ConfigurationResolver->getFormat() phar:///home/jvb/bin/bin/php-cs-fixer/src/Console/ConfigurationResolver.php:405
PHP 9. PhpCsFixer\Console\ConfigurationResolver->getConfig() phar:///home/jvb/bin/bin/php-cs-fixer/src/Console/ConfigurationResolver.php:560
PHP 10. include() phar:///home/jvb/bin/bin/php-cs-fixer/src/Console/ConfigurationResolver.php:215

Make `devtools:documentation --directories` smarter

Related to hoaproject/Central#19.

Currently, the default value for --directories is nothing. So if one would like to generate the documentation for the current library, we need to specify --directories . which is annoying and it does not help when writing documentation.

The default behavior must be smarter by having the current directory by default, so that we no longer need to write --directories .. Any new value could be added or overwrite the default value. I don't have any opinion about it, expect it would be better to overwrite the default value to prevent future BC breaks.

vendor/bin/hoa without arguments = errors

When you run the command without arguments, you get an error

$ vendor/bin/hoa
Hoa\Dispatcher\ClassMethod::resolve(): (0) Class Hoa\Cli\Bin\Welcome is not found (method: GET, asynchronous: false).
in /home/jvb/workspace/_perso/hoa/Compiler/vendor/hoa/dispatcher/ClassMethod.php at line 101.

โฌ‡

Nested exception (ReflectionException):
Class Hoa\Cli\Bin\Welcome does not exist

I'm running PHP 7.0.18-0ubuntu0.17.04.1

Merge Hoathis\Documentation into Hoa\Devtools

Hello ๐Ÿ˜ƒ,

I was thinking about simplifying the contribution process and thought: What about merging the the Hoathis\Documentation tool into this library. For me it makes sense:

  • Less repository to maintain (which is good!),
  • One place for all devtools,
  • Ease the contribution (you install hoa/test which install hoa/devtools and here you go, or you install hoa/devtools and here you go).

Thoughts @hoaproject/hoackers?

Automatically create `.gitignore` when installing

Hello ๐Ÿ˜ƒ,

What about creating a .gitignore file when installed through Composer?

Before composer install:

Foo/
    .git/
    composer.json
    Awesomeness.php

After composer install:

Foo/
    .git/
    .gitignore
    composer.json
    Awesomeness.php
    vendor/
        hoa/
            devtools/
            test/

Allows people to not commit useless stuff. However, .gitignore is still prompted in git status :-/. Is it just a stupid idea? Should we commit all the .gitignore file?

/cc @hoaproject/hoackers and @shulard

Handle error in devtools:documentation

When we try to generate documentation on library without documentation (example https://github.com/hoaproject/Stream), we raise an error like

vendor/bin/hoa devtools:documentation --open
Selected language: En.

Hoa\Devtools\Bin\Documentation::main(): (1) Directory /tmp/Stream does not contain documentation.
in /tmp/Stream/vendor/hoa/devtools/Bin/Documentation.php at line 166.

We need to handle the error to display a better message like

There is no documentation yet, sorry.

Exception thrown during devtools:cs when using a `php-cs-fixer` version > v2.8.0

Hello,

I wanted to run the devtools:cs CS command when working on the #49 PR and got the following error :

$ vendor/bin/hoa devtools:cs Bin/Snapshot.php
Loaded config default from "/Users/shulard/Sites/Forks/Hoa/Devtools/Resource/PHPCSFixer/ConfigurationFile.php".

Fixed all files in 0.127 seconds, 10.000 MB memory used

Files that were not fixed due to errors reported during fixing:
   1) /Users/shulard/Sites/Forks/Hoa/Devtools/Bin/Snapshot.php

I searched around the errors reported during fixing and got the following details when running php-cs-fixer directly :

$ php-cs-fixer fix --config Resource/PHPCSFixer/ConfigurationFile.php --allow-risky yes Bin/Snapshot.php -vvv
Loaded config default from "Resource/PHPCSFixer/ConfigurationFile.php".
E
Legend: ?-unknown, I-invalid file syntax, file ignored, S-Skipped, .-no changes, F-fixed, E-error

Fixed all files in 0.123 seconds, 10.000 MB memory used

Files that were not fixed due to errors reported during fixing:
   1) /Users/shulard/Sites/Forks/Hoa/Devtools/Bin/Snapshot.php


        [ArgumentCountError]
        Too few arguments to function PhpCsFixer\AbstractLinesBeforeNamespaceFixer::fixLinesBeforeNamespace(), 3 passed in /Users/shulard/Sites/Forks/Hoa/Devtools/Resource/PHPCSFixer/Fixer/NoBlankLinesBeforeEntity.php on line 67 and exactly 4 expected


      PhpCsFixer\AbstractLinesBeforeNamespaceFixer->fixLinesBeforeNamespace()
        in /Users/shulard/Sites/Forks/Hoa/Devtools/Resource/PHPCSFixer/Fixer/NoBlankLinesBeforeEntity.php at line 67
      Hoa\Devtools\Resource\PHPCSFixer\Fixer\NoBlankLinesBeforeEntity->applyfix()
        in /usr/local/Cellar/php-cs-fixer/2.10.0/src/AbstractFixer.php at line 73
      PhpCsFixer\AbstractFixer->fix()
        in /usr/local/Cellar/php-cs-fixer/2.10.0/src/Runner/Runner.php at line 190
      PhpCsFixer\Runner\Runner->fixFile()
        in /usr/local/Cellar/php-cs-fixer/2.10.0/src/Runner/Runner.php at line 132
      PhpCsFixer\Runner\Runner->fix()
        in /usr/local/Cellar/php-cs-fixer/2.10.0/src/Console/Command/FixCommand.php at line 219
      PhpCsFixer\Console\Command\FixCommand->execute()
        in /usr/local/Cellar/php-cs-fixer/2.10.0/vendor/symfony/console/Command/Command.php at line 252
      [ ... ]

The PhpCsFixer\AbstractLinesBeforeNamespaceFixer::fixLinesBeforeNamespace signature as changed in PHP-CS-Fixer v2.8.1 :

Since Hoa rely on the host installed php-cs-fixer binary, we have an edge case to check here...

Since PHP-CS-Fixer use the Symfony/Console component, we can check the PhpCsFixer\Console\Application::VERSION constant to check how much parameters we need to use...

Upgrade config file for php-cs-fixer

php-cs-fixer version 1.xx.xx works with this current configuration file Devtools/Resource/PHPCSFixer/ConfigurationFile.php but for the version 2 everything have changed.

Now we need to use --config instead of --config-file to specify the configuration file
All classes have been moved into another namespace and the api is completely changed. @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/19f3e46b09e0de24efa0aea6c2beb42410e37cc8/.php_cs.dist

As you can see also the definition of all rules to check have been change from string to an array.

Create the `hoa devtools:check`

Maybe we should name this command differently, like hoa devtools:configure, I don't know, or maybe hoa devtools:caniuse or devtools:iscompatible.

hoa test:run should also run this command before running tests.

See hoaproject/Central#15.

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.