Coder Social home page Coder Social logo

Comments (9)

veewee avatar veewee commented on June 19, 2024

You want GrumPHP to validate the full codebase? Currently we only run tasks when files have changed.
I am thinking of some continious integration commands that can run all configured tasks on the codebase. More info at #20

from grumphp.

igormukhingmailcom avatar igormukhingmailcom commented on June 19, 2024

Tasks like phunit/behat/phpspec not executed on separate files.
Its executed as is and any file list not passed to it as argument.
So i think that independent types of tasks need to run even if no file changed.

from grumphp.

veewee avatar veewee commented on June 19, 2024

If no PHP file has changed during pre-commit, why should these tasks be ran?
Normally the tests and code should be in the previous committed state and shouldn't contain any errors.

For example: a front-end designer wants to add a CSS file, and all of a sudden he gets an exceptions on the unit tests which he does not know anything about. This doesn't seem to make much sense to me.

What is your opinion @aderuwe ?

from grumphp.

aderuwe avatar aderuwe commented on June 19, 2024

@igormukhingmailcom I spoke to @veewee about this for a couple minutes this morning.
How about we introduce a grumphp:ci (or something similar) command that runs all the tasks on all of the files, while we make it so that "normal" GrumPHP usage is based off of the changed files only? (For independent tasks, as you call them, that would mean we trigger the entire suit, but only if there's changed files.)
What do you think?

from grumphp.

igormukhingmailcom avatar igormukhingmailcom commented on June 19, 2024

@aderuwe I thing that its a great idea.
I propose to name this command something like grumphp run (similar as php-cs-fixer run or phpspec run) or grumphp check, because this command will be used not only with CI.

from grumphp.

igormukhingmailcom avatar igormukhingmailcom commented on June 19, 2024

Also option --skip=task will be helpful I think...

For example:

  • grumphp run --skip=phpunit to skip phpunit tests
  • grumphp run --skip=phpunit,behat to skip phpunit and behat tests

WDYT?

from grumphp.

veewee avatar veewee commented on June 19, 2024

sounds good! This will require some context in which the tasks needs to run.
Also: some tasks will not be able to run, like the blacklist task, since this only checks files that are being committed. So the tasks need to know in which context they can run.
During commit, only the changed files should be added.
During run, all files should be added. (Note: wouldn't this be slow on big codebases?)

This feature will require some thinking about the architecture of the project and propably BC breaks.

from grumphp.

aderuwe avatar aderuwe commented on June 19, 2024

@igormukhingmailcom +1 on both counts!

from grumphp.

veewee avatar veewee commented on June 19, 2024

The run command is implemented. This issue can be closed.
The ability to skip tests is not implemented but is added as a new issue in #50.

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.