Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master #560

Merged
merged 38 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
eda731b
feat: Add additional info option
poppabear8883 Sep 13, 2018
e849351
feat: Add option to disable all banners by setting ascii to null
poppabear8883 Sep 13, 2018
b2ee677
feat(CommitMessage): Add ability to enforce type scope conventions
poppabear8883 Sep 13, 2018
22f75c8
feat(Util): Add string helper class with contains method
poppabear8883 Sep 13, 2018
023d63c
style: Update to satisfy a style preference
poppabear8883 Sep 21, 2018
e775083
Allow PHPLint to handle large number of files.
gsomoza Sep 21, 2018
18d3339
Fix issue when .git file has absolute path
LeighBicknell Sep 25, 2018
be5da30
Merge pull request #545 from leigh-ols/master
veewee Sep 28, 2018
56a29a6
Merge pull request #540 from poppabear8883/feat-ascii-1
veewee Sep 28, 2018
aa6d1ee
fix: Update overlooked documentation referencing an old proposal
poppabear8883 Sep 28, 2018
3217efd
feat: Add private getSubjectLine() to extract duplicated logic
poppabear8883 Sep 28, 2018
b318285
refact: Update methods to make use of getSubjectLine method
poppabear8883 Sep 28, 2018
d31d927
style: Update to satisfy a style preference
poppabear8883 Sep 28, 2018
2de7427
refact: Add docblock to define parameter types and Refactor method name
poppabear8883 Sep 28, 2018
f6ac36e
Merge pull request #539 from poppabear8883/feat-git-1
veewee Oct 1, 2018
0056460
refact: Remove private $exceptions declaration per discussion
poppabear8883 Oct 1, 2018
8ee9e98
refact: Remove useless if statement
poppabear8883 Oct 2, 2018
e2e2393
refact: Refactor to cleanup the method
poppabear8883 Oct 2, 2018
d7b57e1
Merge pull request #541 from poppabear8883/feat-commsg-1
veewee Oct 4, 2018
60b62be
Bump minor version requirement of symfony/process to ~3.2
gsomoza Oct 18, 2018
aa46ac3
- Change the mistakes to `null` instead of `~`.
cafferata Oct 18, 2018
f6ed53a
Merge pull request #552 from cafferata/mark-down-fixes
Landerstraeten Oct 18, 2018
94c2e8e
Add PHP 7.2 EOL to PHP version checker
veewee Oct 26, 2018
86c4862
Merge pull request #557 from veewee/update-version-support
Landerstraeten Oct 26, 2018
18730ba
Host our own version of the symfony XSDs
veewee Oct 26, 2018
4a62b93
Merge pull request #559 from veewee/fix-xsd-tests
Landerstraeten Oct 26, 2018
2dd294c
Add phpunit bridge
dmerchier Mar 30, 2018
744cb68
Add missing property
Oct 30, 2018
db583c7
Revert "Host our own version of the symfony XSDs"
Landerstraeten Oct 31, 2018
ef7af59
Merge pull request #564 from phpro/revert-559-fix-xsd-tests
Landerstraeten Nov 7, 2018
26eb82b
Add ignore patterns for PHPLint task
cafferata Nov 14, 2018
13119bc
Added parameter to toggle show info (#573)
Vesquen Nov 29, 2018
d2d188b
Merge pull request #543 from gsomoza/phplint-input-stream
Landerstraeten Nov 30, 2018
73712a0
Merge pull request #558 from Landerstraeten/phpunit-bridge
Landerstraeten Nov 30, 2018
99924df
Merge pull request #563 from Landerstraeten/add-missing-property
Landerstraeten Nov 30, 2018
cdeeb07
Merge pull request #570 from cafferata/php-lint-ignore-patterns
Landerstraeten Nov 30, 2018
442cce4
Merge branch 'master' into grumpy-seventies
Nov 30, 2018
6be5019
Add php unit bridge
Nov 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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