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

Elixir gherkin parser implementation #1251

Merged
merged 23 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
01fe63b
WIP: code that needs to be refactored (and reviewed)
WannesFransen1994 Nov 17, 2020
8212312
WIP
WannesFransen1994 Nov 17, 2020
62f0a33
WIP: renamed project + all tests are ran despite of failures + test r…
WannesFransen1994 Nov 18, 2020
4b25088
verify link when merged into master
WannesFransen1994 Nov 18, 2020
a2a4cc7
attempt with makefile
WannesFransen1994 Nov 19, 2020
27ebccf
Merge branch 'master' into elixir-gherkin-implementation
WannesFransen1994 Nov 19, 2020
6bc5099
rename files ("ex_gherkin" to "gherkin")
WannesFransen1994 Nov 19, 2020
b874011
Merge branch 'elixir-gherkin-implementation' of github.com:cucumber/c…
WannesFransen1994 Nov 19, 2020
71f8510
update rsync + cicd integration attempt
WannesFransen1994 Nov 23, 2020
0680b1b
cicd integration attempt 2
WannesFransen1994 Nov 23, 2020
44e7d51
makefile foldername fix
WannesFransen1994 Nov 23, 2020
7f01801
Merge branch 'master' into elixir-gherkin-implementation
WannesFransen1994 Nov 23, 2020
450a99a
label during test logging fix
WannesFransen1994 Nov 23, 2020
04ce7c4
Merge branch 'elixir-gherkin-implementation' of github.com:cucumber/c…
WannesFransen1994 Nov 23, 2020
bde65c4
Merge branch 'master' into elixir-gherkin-implementation
WannesFransen1994 Nov 26, 2020
228ac52
update package name to cucumber_gherkin
WannesFransen1994 Dec 3, 2020
1b77aa2
Merge branch 'elixir-gherkin-implementation' of github.com:cucumber/c…
WannesFransen1994 Dec 3, 2020
55f76e1
update comments (and remove some) + translate a comment
WannesFransen1994 Dec 3, 2020
8373178
Merge branch 'master' into elixir-gherkin-implementation
WannesFransen1994 Dec 3, 2020
1372023
Extract common Elixir build files to /.templates/elixir
Dec 10, 2020
de27f23
Merge branch 'master' into elixir-gherkin-implementation
aslakhellesoy Dec 10, 2020
12b23f8
Enable gherkin/elixir in serial build. Add attribution
Dec 10, 2020
052b452
Merge branch 'master' into elixir-gherkin-implementation
aslakhellesoy Dec 10, 2020
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
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,17 @@ jobs:
cd messages/elixir
make

gherkin-elixir:
executor: docker-cucumber-build
steps:
- attach_workspace:
at: "~/cucumber"
- run:
name: gherkin/elixir
command: |
cd gherkin/elixir
make

###
### Workflows ###
###
Expand Down Expand Up @@ -1060,3 +1071,7 @@ workflows:
- messages-elixir:
requires:
- checkout

- gherkin-elixir:
requires:
- checkout
30 changes: 30 additions & 0 deletions .templates/elixir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Created by https://www.toptal.com/developers/gitignore/api/elixir,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=elixir,vscode

### Elixir ###
/_build
/cover
/deps
/doc
/.fetch
erl_crash.dump
*.ez
*.beam
/config/*.secret.exs
.elixir_ls/

### Elixir Patch ###

### vscode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# End of https://www.toptal.com/developers/gitignore/api/elixir,vscode

.deps
.tested
48 changes: 48 additions & 0 deletions .templates/elixir/default.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
SHELL := /usr/bin/env bash
ELIXIR_SOURCE_FILES = $(shell find . -name "*.ex")

default: .tested

.tested: .deps $(ELIXIR_SOURCE_FILES)
mix test
touch $@

.deps:
mix local.hex --force
mix deps.get
touch $@

update-dependencies:
@echo -e "\033[0;31mPlease update dependencies for elixir manually in mix.exs!! Check https://hex.pm/ for the latest version.\033[0m"
@echo -e "\033[0;31mSome packages require some options (such as ex_doc), check the package its readme / hexdocs.\033[0m"
.PHONY: update-dependencies

pre-release: update-version update-dependencies clean default
[ -f '/home/cukebot/import-gpg-key.sh' ] && /home/cukebot/import-gpg-key.sh
.PHONY: pre-release

update-version:
ifdef NEW_VERSION
sed -Ei 's/@vsn "[^"]+"/@vsn "$(NEW_VERSION)"/' mix.exs
else
@echo -e "\033[0;31mNEW_VERSION is not defined. Can't update version :-(\033[0m"
exit 1
endif
.PHONY: update-version

publish: .deps
ifdef HEX_API_KEY
mix hex.publish --yes
else
@echo -e "\033[0;31mHEX_API_KEY is not defined. Can't update version :-(\033[0m"
exit 1
endif

.PHONY: publish

post-release:
@echo "No post-release for elixir projects (yet)"
.PHONY: post-release

clean:
rm -rf _build deps .deps .tested
105 changes: 55 additions & 50 deletions gherkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt

### Added

* [Elixir] New implementation!
([#1251](https://github.com/cucumber/cucumber/pull/1251)
[WannesFransen1994])

### Changed

### Deprecated
Expand Down Expand Up @@ -854,53 +858,54 @@ to Gherkin 2.
[3.1.0]: https://github.com/cucumber/gherkin/compare/v3.0.0...v3.1.0

<!-- Contributors -->
[Ahmed-Ali]: https://github.com/Ahmed-Ali
[ankitpokhrel]: https://github.com/ankitpokhrel
[ajspadial]: https://github.com/ajspadial
[aslakhellesoy]: https://github.com/aslakhellesoy
[badeball]: https://github.com/badeball
[brasmusson]: https://github.com/brasmusson
[charlierudolph]: https://github.com/charlierudolph
[coderbyheart]: https://github.com/coderbyheart
[cyocum]: https://github.com/cyocum
[danilat]: https://github.com/danilat
[davidjgoss]: https://github.com/davidjgoss
[deivid-rodriguez] https://github.com/deivid-rodriguez
[dobiedad]: https://github.com/dobiedad
[ehpc]: https://github.com/ehpc
[enkessler]: https://github.com/enkessler
[gabanz]: https://github.com/gabanz
[Haukinger]: https://github.com/Haukinger
[jargalan]: https://github.com/jargalan
[jmezach]: https://github.com/jmezach
[joscha]: https://github.com/joscha
[koterpillar]: https://github.com/koterpillar
[KniveX]: https://github.com/KniveX
[l3pp4rd]: https://github.com/l3pp4rd
[LiohAu]: https://github.com/LiohAu
[mattwynne]: https://github.com/mattwynne
[mauriciotogneri]: https://github.com/mauriciotogneri
[maximeg]: https://github.com/maximeg
[maxmeyer]: https://github.com/maxmeyer
[mpkorstanje]: https://github.com/mpkorstanje
[merrua]: https://github.com/merrua
[milhcbt]: https://github.com/milhcbt
[moreau-nicolas]: https://github.com/moreau-nicolas
[mpkorstanje]: https://github.com/mpkorstanje
[ookull]: https://github.com/ookull
[nalekberov]: https://github.com/nalekberov
[nixel2007]: https://github.com/nixel2007
[nikolovski]: https://github.com/nikolovski
[noisygerman]: https://github.com/noisygerman
[paigehf]: https://github.com/paigehf
[pjlsergeant]: https://github.com/pjlsergeant
[pmatsinopoulos]: https://github.com/pmatsinopoulos
[rjwittams]: https://github.com/rjwittams
[Pr-Mex]: https://github.com/Pr-Mex
[Pwera]: https://github.com/Pwera
[SabotageAndi]: https://github.com/SabotageAndi
[tsundberg]: https://github.com/tsundberg
[upgundecha]: https://github.com/upgundecha
[vincent-psarga]: https://github.com/vincent-psarga
[zbmott]: https://github.com/zbmott
[Zearin]: https://github.com/Zearin
[Ahmed-Ali]: https://github.com/Ahmed-Ali
[ankitpokhrel]: https://github.com/ankitpokhrel
[ajspadial]: https://github.com/ajspadial
[aslakhellesoy]: https://github.com/aslakhellesoy
[badeball]: https://github.com/badeball
[brasmusson]: https://github.com/brasmusson
[charlierudolph]: https://github.com/charlierudolph
[coderbyheart]: https://github.com/coderbyheart
[cyocum]: https://github.com/cyocum
[danilat]: https://github.com/danilat
[davidjgoss]: https://github.com/davidjgoss
[deivid-rodriguez] https://github.com/deivid-rodriguez
[dobiedad]: https://github.com/dobiedad
[ehpc]: https://github.com/ehpc
[enkessler]: https://github.com/enkessler
[gabanz]: https://github.com/gabanz
[Haukinger]: https://github.com/Haukinger
[jargalan]: https://github.com/jargalan
[jmezach]: https://github.com/jmezach
[joscha]: https://github.com/joscha
[koterpillar]: https://github.com/koterpillar
[KniveX]: https://github.com/KniveX
[l3pp4rd]: https://github.com/l3pp4rd
[LiohAu]: https://github.com/LiohAu
[mattwynne]: https://github.com/mattwynne
[mauriciotogneri]: https://github.com/mauriciotogneri
[maximeg]: https://github.com/maximeg
[maxmeyer]: https://github.com/maxmeyer
[mpkorstanje]: https://github.com/mpkorstanje
[merrua]: https://github.com/merrua
[milhcbt]: https://github.com/milhcbt
[moreau-nicolas]: https://github.com/moreau-nicolas
[mpkorstanje]: https://github.com/mpkorstanje
[ookull]: https://github.com/ookull
[nalekberov]: https://github.com/nalekberov
[nixel2007]: https://github.com/nixel2007
[nikolovski]: https://github.com/nikolovski
[noisygerman]: https://github.com/noisygerman
[paigehf]: https://github.com/paigehf
[pjlsergeant]: https://github.com/pjlsergeant
[pmatsinopoulos]: https://github.com/pmatsinopoulos
[rjwittams]: https://github.com/rjwittams
[Pr-Mex]: https://github.com/Pr-Mex
[Pwera]: https://github.com/Pwera
[SabotageAndi]: https://github.com/SabotageAndi
[tsundberg]: https://github.com/tsundberg
[upgundecha]: https://github.com/upgundecha
[vincent-psarga]: https://github.com/vincent-psarga
[zbmott]: https://github.com/zbmott
[Zearin]: https://github.com/Zearin
[WannesFransen1994]: https://github.com/WannesFransen1994
4 changes: 2 additions & 2 deletions gherkin/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LANGUAGES ?= go javascript ruby java
include default.mk
LANGUAGES ?= go javascript ruby java elixir
include default.mk
5 changes: 5 additions & 0 deletions gherkin/elixir/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PLEASE DO NOT CREATE ISSUES IN THIS REPO.
THIS REPO IS A READ-ONLY MIRROR.

Create your issue in the Cucumber monorepo instead:
https://github.com/cucumber/cucumber/issues
5 changes: 5 additions & 0 deletions gherkin/elixir/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PLEASE DO NOT CREATE PULL REAUESTS IN THIS REPO.
THIS REPO IS A READ-ONLY MIRROR.

Create your pull request in the Cucumber monorepo instead:
https://github.com/cucumber/cucumber/pulls
30 changes: 30 additions & 0 deletions gherkin/elixir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Created by https://www.toptal.com/developers/gitignore/api/elixir,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=elixir,vscode

### Elixir ###
/_build
/cover
/deps
/doc
/.fetch
erl_crash.dump
*.ez
*.beam
/config/*.secret.exs
.elixir_ls/

### Elixir Patch ###

### vscode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# End of https://www.toptal.com/developers/gitignore/api/elixir,vscode

.deps
.tested
6 changes: 6 additions & 0 deletions gherkin/elixir/.rsync
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
../LICENSE LICENSE
../../.templates/github/ .github/
../../.templates/elixir/ .
../testdata/ testdata/
../gherkin.berp resources/gherkin.berp
../gherkin-languages.json resources/gherkin_languages.json
21 changes: 21 additions & 0 deletions gherkin/elixir/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Cucumber Ltd, Gaspar Nagy, Björn Rasmusson, Peter Sergeant

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
12 changes: 12 additions & 0 deletions gherkin/elixir/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include default.mk

.deps: lib/gherkin/parser.ex

lib/gherkin/parser.ex: resources/gherkin.berp gherkin-elixir.razor
mono /var/lib/berp/1.1.1/tools/net471/Berp.exe -g resources/gherkin.berp -t gherkin-elixir.razor -o $@
# Remove BOM
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}{print}' < $@ > $@.nobom
mv $@.nobom $@

clobber: clean
rm -f lib/gherkin/parser.ex
Loading