Skip to content

Commit e2cae5a

Browse files
committed
Add editorconfig; update documentation; reformat y[a]ml
1 parent 3ba83e7 commit e2cae5a

File tree

7 files changed

+91
-73
lines changed

7 files changed

+91
-73
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[*]
2+
indent_size = 4
3+
indent_style = space
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{yml,yaml}]
8+
indent_size = 2

.gitattributes

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/.github/ export-ignore
2-
/bin/ export-ignore
3-
/tests export-ignore
4-
/.gitattributes export-ignore
5-
/.gitignore export-ignore
6-
/package.xml.tpl export-ignore
7-
/phpdoc.ini.dist export-ignore
8-
/phpunit.dist.xml export-ignore
1+
/.github/ export-ignore
2+
/bin/ export-ignore
3+
/tests/ export-ignore
4+
/.editorconfig export-ignore
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/CONTRIBUTING.md export-ignore
8+
/phpunit.dist.xml export-ignore

.github/workflows/build.yml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Build
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [ master ]
66
pull_request:
77
release:
8-
types: [created]
8+
types: [ created ]
99

1010
jobs:
1111
tests:
@@ -14,31 +14,30 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php: [8.1, 8.2, 8.3, 8.4]
17+
php: [ 8.1, 8.2, 8.3, 8.4 ]
1818
composer-flags: [ "" ]
1919
symfony-version: [ "" ]
2020
include:
21-
- php: 8.1
22-
symfony-version: '^5.4'
23-
- php: 8.1
24-
symfony-version: '^6.4'
25-
21+
- php: 8.1
22+
symfony-version: '^5.4'
23+
- php: 8.1
24+
symfony-version: '^6.4'
2625
steps:
27-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v4
2827

29-
- name: Setup PHP
30-
uses: shivammathur/setup-php@v2
31-
with:
32-
php-version: "${{ matrix.php }}"
33-
ini-file: "development"
34-
coverage: none
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: "${{ matrix.php }}"
32+
ini-file: "development"
33+
coverage: none
3534

36-
- name: Update Symfony version
37-
if: matrix.symfony-version != ''
38-
run: composer require --no-update "symfony/symfony:${{ matrix.symfony-version }}"
35+
- name: Update Symfony version
36+
if: matrix.symfony-version != ''
37+
run: composer require --no-update "symfony/symfony:${{ matrix.symfony-version }}"
3938

40-
- name: Install dependencies
41-
run: composer update ${{ matrix.composer-flags }}
39+
- name: Install dependencies
40+
run: composer update ${{ matrix.composer-flags }}
4241

43-
- name: Run tests (phpunit)
44-
run: ./vendor/bin/phpunit
42+
- name: Run tests (phpunit)
43+
run: ./vendor/bin/phpunit

.github/workflows/update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Update Cucumber
22

33
on:
44
schedule:
5-
- cron: '0 7 * * *'
5+
- cron: '0 7 * * *'
66

77
jobs:
88
cucumber-update:

CONTRIBUTING.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
1-
Contributing
2-
------------
1+
# Contributing
32

4-
Gherkin is an open source, community-driven project. If you'd like to contribute, feel free to do this, but remember to follow this few simple rules:
3+
Gherkin is an open source, community-driven project. If you'd like to contribute, feel free to do this, but remember to
4+
follow this few simple rules:
55

66
- Make your feature addition or bug fix,
77
- Always use the `master` branch as base for your changes (all new development happens in `master`),
8-
- Add tests for those changes (please look into `tests/` folder for some examples). This is important so we don't break it in a future version unintentionally,
9-
- Commit your code, but do not mess with `CHANGES.md`,
10-
- __Remember__: when you create Pull Request, always select `master` branch as target (done by default), otherwise it will be closed.
8+
- Add tests for those changes (please look into `tests/` folder for some examples). This is important so we don't break
9+
it in a future version unintentionally,
10+
- Commit your code, but do not mess with `CHANGELOG.md`,
11+
- _Remember_: when you create a Pull Request, always select `master` branch as target (done by default), otherwise it
12+
will be closed.
1113

12-
Running tests
13-
-------------
14+
## Running tests
1415

1516
Make sure that you don't break anything with your changes by running:
1617

17-
```bash
18-
$> phpunit
18+
```shell
19+
composer test
1920
```
2021

21-
Contributing to Gherkin Translations
22-
------------------------------------
22+
## Running Linters
2323

24-
Gherkin supports →40 different languages and you could add more! You might notice
25-
`i18n.php` file in the root of the library. This file is downloaded and **autogenerated**
26-
from original [cucumber/gherkin translations](https://github.com/cucumber/cucumber/blob/master/gherkin/gherkin-languages.json).
27-
So, in order to fix/update/add some translation, you should send Pull Request to the
28-
`cucumber/gherkin` repository. `Behat\Gherkin` will redownload/regenerate translations
29-
from there before each release.
24+
We use automated tools to ensure that the code has a consistent style and is of good quality.
3025

31-
It might sounds difficult, but this way of dictionary sharing gives you ability to
32-
migrate your `*.feature` files from language to language and library to library without
33-
the need to rewrite/modify them - same dictionary (Gherkin) used everywhere.
26+
```shell
27+
composer lint
28+
```
29+
30+
## Contributing to Gherkin Translations
31+
32+
Gherkin supports →40 different languages and you could add more! You might notice `i18n.php` file in the root of
33+
the library. This file is downloaded and **autogenerated** from
34+
original [cucumber/gherkin translations](https://github.com/cucumber/cucumber/blob/master/gherkin/gherkin-languages.json).
35+
So, in order to fix/update/add some translation, you should send a Pull Request to the `cucumber/gherkin` repository.
36+
`Behat\Gherkin` will re-download/regenerate translations from there before each release.
37+
38+
It might sound difficult, but this way of dictionary-sharing gives us the ability to migrate `*.feature` files from
39+
language to language and library to library without the need to rewrite/modify them - with the same (Gherkin) dictionary
40+
used everywhere.

README.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
Behat Gherkin Parser
2-
====================
1+
# Behat Gherkin Parser
32

4-
This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages
5-
(see `i18n.php`) support & clean architecture.
3+
This is the php Gherkin parser for Behat. It comes bundled with more than 40 native languages (see `i18n.php`) support
4+
and clean architecture.
65

7-
Useful Links
8-
------------
6+
## Useful Links
97

10-
- Official Google Group is at [http://groups.google.com/group/behat](http://groups.google.com/group/behat)
11-
- IRC channel on [#freenode](http://freenode.net/) is `#behat`
8+
- [Behat Site](https://behat.org)
129
- [Note on Patches/Pull Requests](CONTRIBUTING.md)
1310

14-
Usage Example
15-
-------------
11+
## Usage Example
1612

17-
``` php
13+
```php
1814
<?php
1915

2016
$keywords = new Behat\Gherkin\Keywords\ArrayKeywords(array(
@@ -49,16 +45,14 @@ $parser = new Behat\Gherkin\Parser($lexer);
4945
$feature = $parser->parse(file_get_contents('some.feature'));
5046
```
5147

52-
Installing Dependencies
53-
-----------------------
48+
## Installing Dependencies
5449

55-
``` bash
56-
$> curl http://getcomposer.org/installer | php
57-
$> php composer.phar update
50+
```shell
51+
curl https://getcomposer.org/installer | php
52+
php composer.phar update
5853
```
5954

60-
Contributors
61-
------------
55+
## Contributors
6256

6357
* Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer]
6458
* Other [awesome developers](https://github.com/Behat/Gherkin/graphs/contributors)

composer.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "behat/gherkin",
33
"description": "Gherkin DSL parser for PHP",
44
"keywords": ["BDD", "parser", "DSL", "Behat", "Gherkin", "Cucumber"],
5-
"homepage": "http://behat.org/",
5+
"homepage": "https://behat.org/",
66
"type": "library",
77
"license": "MIT",
88
"authors": [
99
{
1010
"name": "Konstantin Kudryashov",
1111
"email": "ever.zet@gmail.com",
12-
"homepage": "http://everzet.com"
12+
"homepage": "https://everzet.com"
1313
}
1414
],
1515

@@ -63,5 +63,15 @@
6363
}
6464
}
6565
}
66-
]
66+
],
67+
68+
"scripts": {
69+
"lint": [
70+
"Composer\\Config::disableProcessTimeout"
71+
],
72+
"test": [
73+
"Composer\\Config::disableProcessTimeout",
74+
"vendor/bin/phpunit ./tests"
75+
]
76+
}
6777
}

0 commit comments

Comments
 (0)