Comments (9)
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.
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.
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.
@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.
@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.
Also option --skip=task
will be helpful I think...
For example:
grumphp run --skip=phpunit
to skip phpunit testsgrumphp run --skip=phpunit,behat
to skip phpunit and behat tests
WDYT?
from grumphp.
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.
@igormukhingmailcom +1 on both counts!
from grumphp.
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)
- Consider adding a `composer.lock` file in the repository HOT 14
- phpcs does not detect default ruleset xml file HOT 6
- PHPMD task does not check all file extensions HOT 5
- Don't do commit message checks on merges? HOT 8
- Memory is not being released in parallel execution HOT 2
- Grumphp running without `.git` folder? HOT 4
- Print the commit message when failing on `git_commit_message` HOT 4
- how can I use grum with docker-compose ? HOT 3
- Fails to Recognize PHPStan Baseline During Commit Workflow
- Override open_basedir only for grumphp test HOT 2
- Grumphp config using default PHPCS XML and other standard's sniff HOT 2
- Undefined constant PhpParser\ParserFactory::PREFER_PHP7 when using `nikic/php-parser` version 5. HOT 1
- Support multiple php versions for tasks HOT 2
- [Task] Add bin/console task for Symfony HOT 1
- husky/lint-staged compatibility HOT 5
- The application requires the version "^7.2" or greater. HOT 2
- Support for multiple PHPStan tasks HOT 2
- How do you think about a configuration to opt-in to continue the commit if fixer could fix everything automatically? HOT 2
- DistFileLoader doesn't import another file
- Add support for git_pre_push HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grumphp.