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
  • 45 minutes ago
  • 12 years ago

Installs

  • Total 29K
  • Win 10K
  • Mac 13K
  • Linux 5K
Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25
Windows 0 0 0 0 0 3 1 1 0 0 0 0 2 1 1 2 0 1 0 0 0 3 1 0 0 0 0 0 1 1 0 0 2 0 0 0 0 0 0 0 1 1 0 0 0
Mac 2 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 1 0 2 0 0
Linux 0 0 0 0 0 2 0 0 0 0 0 1 0 3 2 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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