ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Gherkin (Cucumber) Formatter

by waynemoore ALL

Gherkin Formatter for Sublime Text 2 and 3

Details

  • 2014.12.24.13.04.54
  • github.​com
  • github.​com
  • 10 years ago
  • 46 minutes ago
  • 12 years ago

Installs

  • Total 29K
  • Win 10K
  • Mac 14K
  • Linux 6K
Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28
Windows 0 0 1 0 0 1 1 0 2 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0
Mac 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 1 1 1 0 1 1 0 1 0 0 0 1 0 1 0 1
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
01234Jun 11Jun 8Jun 5Jun 2May 30May 27May 24May 21May 18May 15May 12May 9May 6May 3Apr 30Jun 11 Linux: 0 Mac: 0 Windows: 0Jun 10 Linux: 0 Mac: 0 Windows: 0Jun 9 Linux: 0 Mac: 0 Windows: 1Jun 8 Linux: 0 Mac: 0 Windows: 0Jun 7 Linux: 0 Mac: 0 Windows: 0Jun 6 Linux: 0 Mac: 0 Windows: 1Jun 5 Linux: 0 Mac: 0 Windows: 1Jun 4 Linux: 0 Mac: 0 Windows: 0Jun 3 Linux: 0 Mac: 0 Windows: 2Jun 2 Linux: 0 Mac: 1 Windows: 0Jun 1 Linux: 0 Mac: 0 Windows: 0May 31 Linux: 0 Mac: 0 Windows: 0May 30 Linux: 0 Mac: 0 Windows: 1May 29 Linux: 1 Mac: 0 Windows: 0May 28 Linux: 0 Mac: 2 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 1 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 0 Mac: 0 Windows: 0May 23 Linux: 0 Mac: 0 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 0May 21 Linux: 0 Mac: 0 Windows: 1May 20 Linux: 0 Mac: 2 Windows: 0May 19 Linux: 0 Mac: 0 Windows: 1May 18 Linux: 0 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 0 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 1May 14 Linux: 0 Mac: 0 Windows: 0May 13 Linux: 0 Mac: 1 Windows: 0May 12 Linux: 0 Mac: 1 Windows: 0May 11 Linux: 0 Mac: 1 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 1 Windows: 1May 8 Linux: 0 Mac: 1 Windows: 0May 7 Linux: 0 Mac: 0 Windows: 0May 6 Linux: 0 Mac: 1 Windows: 0May 5 Linux: 0 Mac: 0 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 0May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 1 Windows: 1May 1 Linux: 0 Mac: 0 Windows: 1Apr 30 Linux: 0 Mac: 1 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 1 Windows: 0Jun 11 Linux: 0 Mac: 0 Windows: 0Jun 10 Linux: 0 Mac: 0 Windows: 0Jun 9 Linux: 0 Mac: 0 Windows: 1Jun 8 Linux: 0 Mac: 0 Windows: 0Jun 7 Linux: 0 Mac: 0 Windows: 0Jun 6 Linux: 0 Mac: 0 Windows: 1Jun 5 Linux: 0 Mac: 0 Windows: 1Jun 4 Linux: 0 Mac: 0 Windows: 0Jun 3 Linux: 0 Mac: 0 Windows: 2Jun 2 Linux: 0 Mac: 1 Windows: 0Jun 1 Linux: 0 Mac: 0 Windows: 0May 31 Linux: 0 Mac: 0 Windows: 0May 30 Linux: 0 Mac: 0 Windows: 1May 29 Linux: 1 Mac: 0 Windows: 0May 28 Linux: 0 Mac: 2 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 1 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 0 Mac: 0 Windows: 0May 23 Linux: 0 Mac: 0 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 0May 21 Linux: 0 Mac: 0 Windows: 1May 20 Linux: 0 Mac: 2 Windows: 0May 19 Linux: 0 Mac: 0 Windows: 1May 18 Linux: 0 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 0 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 1May 14 Linux: 0 Mac: 0 Windows: 0May 13 Linux: 0 Mac: 1 Windows: 0May 12 Linux: 0 Mac: 1 Windows: 0May 11 Linux: 0 Mac: 1 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 1 Windows: 1May 8 Linux: 0 Mac: 1 Windows: 0May 7 Linux: 0 Mac: 0 Windows: 0May 6 Linux: 0 Mac: 1 Windows: 0May 5 Linux: 0 Mac: 0 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 0May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 1 Windows: 1May 1 Linux: 0 Mac: 0 Windows: 1Apr 30 Linux: 0 Mac: 1 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 1 Windows: 0Jun 11 Linux: 0 Mac: 0 Windows: 0Jun 10 Linux: 0 Mac: 0 Windows: 0Jun 9 Linux: 0 Mac: 0 Windows: 1Jun 8 Linux: 0 Mac: 0 Windows: 0Jun 7 Linux: 0 Mac: 0 Windows: 0Jun 6 Linux: 0 Mac: 0 Windows: 1Jun 5 Linux: 0 Mac: 0 Windows: 1Jun 4 Linux: 0 Mac: 0 Windows: 0Jun 3 Linux: 0 Mac: 0 Windows: 2Jun 2 Linux: 0 Mac: 1 Windows: 0Jun 1 Linux: 0 Mac: 0 Windows: 0May 31 Linux: 0 Mac: 0 Windows: 0May 30 Linux: 0 Mac: 0 Windows: 1May 29 Linux: 1 Mac: 0 Windows: 0May 28 Linux: 0 Mac: 2 Windows: 0May 27 Linux: 0 Mac: 0 Windows: 0May 26 Linux: 1 Mac: 0 Windows: 0May 25 Linux: 0 Mac: 0 Windows: 0May 24 Linux: 0 Mac: 0 Windows: 0May 23 Linux: 0 Mac: 0 Windows: 0May 22 Linux: 0 Mac: 0 Windows: 0May 21 Linux: 0 Mac: 0 Windows: 1May 20 Linux: 0 Mac: 2 Windows: 0May 19 Linux: 0 Mac: 0 Windows: 1May 18 Linux: 0 Mac: 0 Windows: 0May 17 Linux: 0 Mac: 0 Windows: 0May 16 Linux: 0 Mac: 0 Windows: 0May 15 Linux: 0 Mac: 0 Windows: 1May 14 Linux: 0 Mac: 0 Windows: 0May 13 Linux: 0 Mac: 1 Windows: 0May 12 Linux: 0 Mac: 1 Windows: 0May 11 Linux: 0 Mac: 1 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 0May 9 Linux: 0 Mac: 1 Windows: 1May 8 Linux: 0 Mac: 1 Windows: 0May 7 Linux: 0 Mac: 0 Windows: 0May 6 Linux: 0 Mac: 1 Windows: 0May 5 Linux: 0 Mac: 0 Windows: 0May 4 Linux: 0 Mac: 0 Windows: 0May 3 Linux: 0 Mac: 0 Windows: 0May 2 Linux: 0 Mac: 1 Windows: 1May 1 Linux: 0 Mac: 0 Windows: 1Apr 30 Linux: 0 Mac: 1 Windows: 1Apr 29 Linux: 0 Mac: 0 Windows: 0Apr 28 Linux: 0 Mac: 1 Windows: 0

Readme

Source
raw.​githubusercontent.​com

Sublime Gherkin Formatter

Features

At this stage all it really does is format example group tables. The entire buffer will be formatted unless you select a specific region.

Spacing

Tables that look like this:

|cat breeds|country|
|Manx|Isle of Man|
|Octocat|The Web|

Will be reformatted to:

| cat breeds | country     |
| Manx       | Isle of Man |
| Octocat    | The Web     |

Indentation

Usually, people like to indent their tables from the rest of the text. This plugin respects the first line of the group's indent. So the following:

Then the "<cat breed>" is from "<country>"
    | cat breeds | country     |
| Manx       | Isle of Man |
            | Octocat    | The Web     |

Will be indented to:

Then the "<cat breed>" is from "<country>"
    | cat breeds | country     |
    | Manx       | Isle of Man |
    | Octocat    | The Web     |

Installing

Package control

You can now install this plugin using Sublime Package Control.

  1. Open Command Palette (<Cmd> + <Shift> + P on a Mac, or access via Tools menu)
  2. Find and select “Package Control: Install Package”
  3. Find and install “Gherkin (Cucumber) Formatter”

Manual

You can install this plugin manually by cloning it to your Sublime plugins directory:

$ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
$ git clone git://github.com/waynemoore/sublime-gherkin-formatter.git

Usage

There are a few ways to use it:

  • <Cmd> + <Shift> + | - This matches the TextMate cucumber plugin's key binding.
  • <Ctrl> + <Alt> + G - DEPRECATED. Original key binding still set to avoid surprise when upgrading the plugin.
  • Select “Gherkin/Cucumber: Format” from the Command Palette.

Contributing

It's a Python project, so I recommend you make use of virtualenv to manage dependencies.

  1. Clone repository
  2. $ pip install -r requirements.pip
  3. $ nosetests
  4. Write a test
  5. Implement your feature / bugfix
  6. Open a pull request

Contributors