Skip to content

Commit

Permalink
Add editorconfig; update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
uuf6429 committed Dec 7, 2024
1 parent d07d2ba commit 99d108d
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 46 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*]
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
20 changes: 12 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
/.github/ export-ignore
/bin/ export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/package.xml.tpl export-ignore
/phpdoc.ini.dist 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
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
/package.xml.tpl export-ignore
/phpdoc.ini.dist export-ignore
/phpunit.dist.xml export-ignore
/README.md export-ignore
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.
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
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.

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`
- [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 +46,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 99d108d

Please sign in to comment.