Skip to content

Commit

Permalink
Merge pull request #274 from uuf6429/chore/update-documentation
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
carlos-granados authored Dec 10, 2024
2 parents 0b191b1 + 05dbf33 commit 6b652ca
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 71 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*]
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true

[*.{yml,yaml}]
indent_size = 2
14 changes: 8 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/.github/ export-ignore
/bin/ export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.dist.xml export-ignore
/.github/ export-ignore
/bin/ export-ignore
/tests/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/CONTRIBUTING.md export-ignore
/phpunit.dist.xml export-ignore
43 changes: 21 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Build

on:
push:
branches: [master]
branches: [ master ]
pull_request:
release:
types: [created]
types: [ created ]

jobs:
tests:
Expand All @@ -14,31 +14,30 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3, 8.4]
php: [ 8.1, 8.2, 8.3, 8.4 ]
composer-flags: [ "" ]
symfony-version: [ "" ]
include:
- php: 8.1
symfony-version: '^5.4'
- php: 8.1
symfony-version: '^6.4'

- php: 8.1
symfony-version: '^5.4'
- php: 8.1
symfony-version: '^6.4'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
ini-file: "development"
coverage: none
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
ini-file: "development"
coverage: none

- name: Update Symfony version
if: matrix.symfony-version != ''
run: composer require --no-update "symfony/symfony:${{ matrix.symfony-version }}"
- name: Update Symfony version
if: matrix.symfony-version != ''
run: composer require --no-update "symfony/symfony:${{ matrix.symfony-version }}"

- name: Install dependencies
run: composer update ${{ matrix.composer-flags }}
- name: Install dependencies
run: composer update ${{ matrix.composer-flags }}

- name: Run tests (phpunit)
run: ./vendor/bin/phpunit
- name: Run tests (phpunit)
run: ./vendor/bin/phpunit
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Cucumber

on:
schedule:
- cron: '0 7 * * *'
- cron: '0 7 * * *'

jobs:
cucumber-update:
Expand Down
49 changes: 28 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
Contributing
------------
# Contributing

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:
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:

- Make your feature addition or bug fix,
- Always use the `master` branch as base for your changes (all new development happens in `master`),
- 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,
- Commit your code, but do not mess with `CHANGES.md`,
- __Remember__: when you create Pull Request, always select `master` branch as target (done by default), otherwise it will be closed.
- 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,
- Commit your code, but do not mess with `CHANGELOG.md`,
- _Remember_: when you create a Pull Request, always select `master` branch as target (done by default), otherwise it
will be closed.

Running tests
-------------
## Running tests

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

```bash
$> phpunit
```shell
composer test
```

Contributing to Gherkin Translations
------------------------------------
## Running Linters

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

It might sounds difficult, but this way of dictionary sharing gives you ability to
migrate your `*.feature` files from language to language and library to library without
the need to rewrite/modify them - same dictionary (Gherkin) used everywhere.
```shell
composer lint
```

## Contributing to Gherkin Translations

Gherkin supports →40 different languages and you could add more! You might notice `i18n.php` file in the root of
the library. This file is downloaded and **autogenerated** from
original [cucumber/gherkin translations](https://github.com/cucumber/cucumber/blob/master/gherkin/gherkin-languages.json).
So, in order to fix/update/add some translation, you should send a Pull Request to the `cucumber/gherkin` repository.
`Behat\Gherkin` will re-download/regenerate translations from there before each release.

It might sound difficult, but this way of dictionary-sharing gives us the ability to migrate `*.feature` files from
language to language and library to library without the need to rewrite/modify them - with the same (Gherkin) dictionary
used everywhere.
30 changes: 12 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
Behat Gherkin Parser
====================
# Behat Gherkin Parser

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

Useful Links
------------
## Useful Links

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

Usage Example
-------------
## Usage Example

``` php
```php
<?php

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

Installing Dependencies
-----------------------
## Installing Dependencies

``` bash
$> curl http://getcomposer.org/installer | php
$> php composer.phar update
```shell
curl https://getcomposer.org/installer | php
php composer.phar update
```

Contributors
------------
## Contributors

* Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer]
* Other [awesome developers](https://github.com/Behat/Gherkin/graphs/contributors)
16 changes: 13 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "behat/gherkin",
"description": "Gherkin DSL parser for PHP",
"keywords": ["BDD", "parser", "DSL", "Behat", "Gherkin", "Cucumber"],
"homepage": "http://behat.org/",
"homepage": "https://behat.org/",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "[email protected]",
"homepage": "http://everzet.com"
"homepage": "https://everzet.com"
}
],

Expand Down Expand Up @@ -63,5 +63,15 @@
}
}
}
]
],

"scripts": {
"lint": [
"Composer\\Config::disableProcessTimeout"
],
"test": [
"Composer\\Config::disableProcessTimeout",
"vendor/bin/phpunit ./tests"
]
}
}

0 comments on commit 6b652ca

Please sign in to comment.