Coder Social home page Coder Social logo

Comments (13)

veewee avatar veewee commented on June 16, 2024

I read the discussion at: PHP-CS-Fixer/PHP-CS-Fixer#1719
One thing we could do is read the .php_cs configuration file and use the configured finder to filter the files in our resultset. Not sure if this is possible and how it should be done, but I think this is the best option which will also speed up the phpcsfixer task in GrumPHP. (Currently the phpcsfixer is pretty slow because the tool runs for every committed file. It was on my checklist to take a look on how to improve this speed.)

Would this possible solution solve your issue?

from grumphp.

tifabien avatar tifabien commented on June 16, 2024

Your solution seems interesting and I think it should solve this issue :)

from grumphp.

keradus avatar keradus commented on June 16, 2024

Please play with PHP-CS-Fixer/PHP-CS-Fixer#1742

from grumphp.

veewee avatar veewee commented on June 16, 2024

@keradus,

I just took a look at the commit and it will probably solve @tifabien's problem.
Yesterday I started on a similar approach, but in GrumPHP: veewee@77bfdf4
As you can see, the phpcsfixer configuration is being loaded and an intersection between the finder in phpcsfixer and the commited files in GrumPHP is being made. This was mostly done for starting less phpcsfixer commands, but would also fix this problem.

Just out of curiousity: might it also be an option to add multiple directories / files to the CLI arguments?
Currently we have to start phpcsfixer for every file that is being changed during a commit. This is a pretty slow task.

from grumphp.

keradus avatar keradus commented on June 16, 2024

I started mine yesterday as well ;)

Your solution would be problematic when one want to run GrumPHP with PHP CS Fixer v2@dev, as you start using the PHP CS Fixer classes.

That is exactly my goal, but first I will need to deal with PHP-CS-Fixer/PHP-CS-Fixer#1744 and probably PHP-CS-Fixer/PHP-CS-Fixer#1666

from grumphp.

veewee avatar veewee commented on June 16, 2024

Okay, that would be great! So I guess there is nothing we can do in our project. I don't think this cross version support is soemthing we want to add to GrumPHP.
We will have to wait until this is fixed in php-cs-fixer and for the multiple files until this is implemented.

from grumphp.

keradus avatar keradus commented on June 16, 2024

So I guess there is nothing we can do in our project.

You can do it on your end but not sure is it needed to be implemented twice.

I don't think this cross version support is soemthing we want to add to GrumPHP.

That could be tricky indeed.
One question about it - when there will be PHP CS Fixer 2.0, you will only support 1.x or 2.x ?

from grumphp.

veewee avatar veewee commented on June 16, 2024

Not sure yet. I haven't looked at phpcsfixer v2 yet.
If the CLI is more or less the same, it might be possible to support both.
If that is not possible, we will probably force the usage of v2 at some point.
It's a development tool, so I guess that won't be a big problem to upgrade.

from grumphp.

keradus avatar keradus commented on June 16, 2024

Guide for CLI usage upgrade: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/UPGRADE.md
May be useful.

from grumphp.

veewee avatar veewee commented on June 16, 2024

Looks great! Thanks!

from grumphp.

veewee avatar veewee commented on June 16, 2024

@keradus: It seems like the 2 issues in php-cs-fixer you mentioned got merged. Is this issue resolved?

from grumphp.

keradus avatar keradus commented on June 16, 2024

Hi @veewee ,
PHP-CS-Fixer/PHP-CS-Fixer#1742 is merged indeed, but it's merged into 2.x@dev line (not 1.x@stable).

Anyway, I think this is more an issue of PHP CS Fixer, and as such there is no need for having the issue opened here, as grumphp may be considered as tool-runner.

from grumphp.

veewee avatar veewee commented on June 16, 2024

Ok, Thanks!

from grumphp.

Related Issues (20)

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.