Skip to content

Commit

Permalink
Merge pull request #560 from Landerstraeten/grumpy-seventies
Browse files Browse the repository at this point in the history
Merge master
  • Loading branch information
Landerstraeten authored Nov 30, 2018
2 parents 137b126 + 6be5019 commit 2f99a6f
Show file tree
Hide file tree
Showing 30 changed files with 788 additions and 21 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ parameters:
phpspec: ~
phpstan: ~
phpunit: ~
phpunitbridge: ~
phpversion: ~
progpilot: ~
psalm: ~
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"symfony/filesystem": "~2.7|~3.0|~4.0",
"symfony/finder": "~2.7|~3.0|~4.0",
"symfony/options-resolver": "~2.7|~3.0|~4.0",
"symfony/process": "~2.7|~3.0|~4.0",
"symfony/process": "~3.2|~4.0",
"symfony/yaml": "~2.7|~3.0|~4.0"
},
"require-dev": {
Expand Down Expand Up @@ -57,6 +57,7 @@
"sensiolabs/security-checker": "Lets GrumPHP be sure that there are no known security issues.",
"squizlabs/php_codesniffer": "Lets GrumPHP sniff on your code.",
"sstalle/php7cc": "Lets GrumPHP check PHP 5.3 - 5.6 code compatibility with PHP 7.",
"symfony/phpunit-bridge": "Lets GrumPHP run your unit tests with the phpunit-bridge of Symfony.",
"vimeo/psalm": "Lets GrumPHP discover errors in your code without running it."
},
"authors": [
Expand Down
33 changes: 32 additions & 1 deletion doc/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parameters:
process_async_limit: 10
process_async_wait: 1000
process_timeout: 60
additonal_info: ~
ascii:
failed: resource/grumphp-grumpy.txt
succeeded: resource/grumphp-happy.txt
Expand Down Expand Up @@ -108,6 +109,28 @@ If you've got tools that run more then 60 seconds, you can increase this paramet
It is also possible to disable the timeout by setting the value to `null`.
When receiving a `Symfony\Component\Process\Exception\ProcessTimedOutException` during the execution of GrumPHP, you probably need to increment this setting.

**additional_info**

*Default: null*

This parameter will display additional information at the end of a `success` *or* `error` task.

```yaml
# grumphp.yml
parameters:
additional_info: "\nTo get full documentation for the project!\nVisit https://docs.example.com\n"
```

*Example Result:*
```
GrumPHP is sniffing your code!
Running task 1/1: Phpcs... ✔

To get full documentation for the project!
Visit https://docs.example.com

```
**ascii**
*Default: {failed: grumphp-grumpy.txt, succeeded: grumphp-happy.txt}*
Expand All @@ -132,7 +155,15 @@ parameters:
- resource/grumphp-happy3.txt
```

To disable banner set ascii images path to `~`:
To disable all banners set ascii to `~`:

```yaml
# grumphp.yml
parameters:
ascii: ~
```
To disable a specific banner set ascii image path to `~`:

```yaml
# grumphp.yml
Expand Down
2 changes: 2 additions & 0 deletions doc/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ parameters:
phpspec: ~
phpstan: ~
phpunit: ~
phpunitbridge: ~
phpversion: ~
progpilot: ~
psalm: ~
Expand Down Expand Up @@ -95,6 +96,7 @@ Every task has it's own default configuration. It is possible to overwrite the p
- [Phpspec](tasks/phpspec.md)
- [PHPStan](tasks/phpstan.md)
- [Phpunit](tasks/phpunit.md)
- [Phpunit bridge](tasks/phpunitbridge.md)
- [PhpVersion](tasks/phpversion.md)
- [Progpilot](tasks/progpilot.md)
- [Psalm](tasks/psalm.md)
Expand Down
6 changes: 3 additions & 3 deletions doc/tasks/composer_require_checker.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ parameters:
**composer_file**
*Default: ~*
*Default: null*
The composer.json of your code base that should be checked.
**config_file**
*Default: ~*
*Default: null*
Composer Require Checker is configured to whitelist some symbols by default. You can now override this configuration
with your own and tell GrumPHP to use that configuration file instead.
Expand All @@ -44,6 +44,6 @@ This option is only available in version 0.2.0 of `maglnet/composer-require-chec

**triggered_by**

*Default: ['composer.json', 'composer.lock', '*.php']*
*Default: ['composer.json', 'composer.lock', '\*.php']*

This is a list of file names that should trigger this task.
1 change: 1 addition & 0 deletions doc/tasks/git_branch_name.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ parameters:
matchers:
Branch name must contain JIRA issue number: /JIRA-\d+/
additional_modifiers: ''
allow_detached_head: true
```
**matchers**
Expand Down
74 changes: 74 additions & 0 deletions doc/tasks/git_commit_message.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ parameters:
git_commit_message:
allow_empty_message: false
enforce_capitalized_subject: true
enforce_no_subject_punctuations: false
enforce_no_subject_trailing_period: true
enforce_single_lined_subject: true
type_scope_conventions: []
max_body_width: 72
max_subject_width: 60
matchers:
Expand All @@ -33,6 +35,12 @@ Controls whether or not empty commit messages are allowed.
Ensures that the commit message subject line starts with a capital letter.
**enforce_no_subject_punctuations**
*Default: false*
Ensures that the commit message subject line doesn't have any punctuations characters.
**enforce_no_subject_trailing_period**
*Default: true*
Expand Down Expand Up @@ -95,3 +103,69 @@ additional_modifiers: 'u'

additional_modifiers: 'xu'
```
**type_scope_conventions**
*Default: []*
Enable a commonly used convention for the subject line.
Format is as follows:
```
type[(scope)]: subject
```
*The scope is optional*
Good examples:
```
fix: Security issue with password hashing
fix(Password): Security issue with password hashing
```
**types**
*Default: []*
*To be used with `type_scope_conventions`*

Specify a list of acceptable types. Default allows ***all*** types.

Add one or multiple types like:
```yaml
type_scope_conventions:
- types:
- build
- ci
- chore
- docs
- feat
- fix
- perf
- refactor
- revert
- style
- test
- scopes: []
```

**scopes**

*Default: []*

*To be used with `type_scope_conventions`*

Specify a list of acceptable scopes. Default allows ***all*** scopes.

Add one or multiple scopes like:
```yaml
type_scope_conventions:
- types: []
- scopes:
- api
- index
- user
- language
- browser
- environment
```

7 changes: 7 additions & 0 deletions doc/tasks/phplint.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ parameters:
phplint:
exclude: []
jobs: ~
ignore_patterns: []
triggered_by: ['php', 'phtml', 'php3', 'php4', 'php5']
```
**exclude**
Expand All @@ -34,6 +35,12 @@ The number of jobs you wish to use for parallel processing. If no number
is given, it is left up to parallel-lint itself, which currently
defaults to 10.
**ignore_patterns**
*Default: []*
This is a list of patterns that will be ignored by PHPLint. Leave this option blank to run PHPLint for every php file.
**trigered_by**
*Default: ['php', 'phtml', 'php3', 'php4', 'php5']*
Expand Down
4 changes: 2 additions & 2 deletions doc/tasks/phpstan.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ parameters:
**autoload_file**
*Default: ~*
*Default: null*
With this parameter you can specify the path your project's additional autoload file path.
**configuration**
*Default: ~*
*Default: null*
With this parameter you can specify the path your project's configuration file.
Expand Down
56 changes: 56 additions & 0 deletions doc/tasks/phpunitbridge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Phpunit bridge

The Phpunit Bridge task will run your unit tests thanks to the Symfony Phpunit Bridge.

***Composer***

```
composer require --dev symfony/phpunit-bridge
```

***Config***

The task lives under the `phpunitbridge` namespace and has following configurable parameters:

```yaml
# grumphp.yml
parameters:
tasks:
phpunitbridge:
config_file: ~
testsuite: ~
group: []
always_execute: false
```
**config_file**
*Default: null*
If your phpunit.xml file is located at an exotic location, you can specify your custom config file location with this option.
This option is set to `null` by default.
This means that `phpunit.xml` or `phpunit.xml.dist` are automatically loaded if one of them exist in the current directory.


**testsuite**

*Default: null*

If you wish to only run tests from a certain Suite.
`testsuite: unit`


**group**

*Default: array()*

If you wish to only run tests from a certain Group.
`group: [fast,quick,small]`


**always_execute**

*Default: false*

Always run the whole test suite, even if no PHP files were changed.

2 changes: 1 addition & 1 deletion doc/tasks/phpversion.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It lives under the `phpversion` namespace and has following configurable paramet
parameters:
tasks:
phpversion:
project: '7.0'
project: '7.2'
```
**project**
Expand Down
11 changes: 9 additions & 2 deletions doc/tasks/psalm.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ parameters:
report: ~
threads: 1
triggered_by: ['php']
show_info: false
```
**config**
*Default: ~*
*Default: null*
With this parameter you can specify the path your project's configuration file.
Expand All @@ -48,7 +49,7 @@ With this parameter you can run Psalm without using the cache file.
**report**
*Default: ~*
*Default: null*
With this path you can specify the path your psalm report file
Expand All @@ -65,3 +66,9 @@ This parameter defines on how many threads Psalm's analysis stage is ran.
*Default: [php]*
This is a list of extensions to be sniffed.
**show_info**
*Default: false*
Show non-exception parser findings
1 change: 1 addition & 0 deletions resources/config/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parameters:
git_dir: .
hooks_dir: ~
hooks_preset: local
additional_info: ~
tasks: []
testsuites: []
stop_on_failure: false
Expand Down
9 changes: 9 additions & 0 deletions resources/config/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@ services:
tags:
- {name: grumphp.task, config: phpunit}

task.phpunitbridge:
class: GrumPHP\Task\PhpunitBridge
arguments:
- '@config'
- '@process_builder'
- '@formatter.raw_process'
tags:
- {name: grumphp.task, config: phpunitbridge}

task.phpversion:
class: GrumPHP\Task\PhpVersion
arguments:
Expand Down
1 change: 1 addition & 0 deletions resources/config/util.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ services:
'5.6': '2018-12-31 23:59:59'
'7.0': '2018-12-03 23:59:59'
'7.1': '2019-12-01 23:59:59'
'7.2': '2020-11-30 23:59:59'
Loading

0 comments on commit 2f99a6f

Please sign in to comment.