Giter Club home page Giter Club logo

gherkinlinter's Introduction

gherkinlinter's People

Contributors

saw-jan avatar

Watchers

James Cloos avatar  avatar Phil Davis avatar Roshan Lamichhane avatar Prarup Gurung avatar Ashish Bhattarai avatar Swoichha Adhikari avatar

gherkinlinter's Issues

Formatting rules to implement

Rules:

  • Indentation
    • Feature - 0
    • User story - indent x 1
    • Rule - indent x 1
    • Background, Scenario - indent x 1 or indent x 2
    • Steps, Examples - indent x 2 or indent x 3
    • Data table, Example table, Doc string - indent x 3 or indent x 4
    • Tags, Comments - based on Keyword below
  • New line to separate Feature, Rule, Background, Scenario, Scenario Outline
  • A space between # and comment line. E.g. # some comment
  • Table format
  • No extra spaces at the end of the line
  • New line at the end of the file

Sample formatted text (dots . represent space):
where; indent = 2 spaces

@webui
Feature: login feature
..As a user
..I want to login
..So that I can view the dashboard

..Rule: Valid login

....# we setup the app here
....Background:
......Given some setup has been done

....@validlogin
....Scenario: login
......When the user logs in with following data:
........| username | password |
........| Alice    |  1234    |
......Then the user should see the dashboard
<\n>

OR

@webui
Feature: login feature
..As a user
..I want to login
..So that I can view the dashboard

..Background:
....Given some setup has been done

..@validlogin
..Scenario: login
....When the user logs in with "<username>" and "<password>"
....Then the user should see the dashboard
....Examples:
......| username | password |
......| Alice    |  1234    |
<\n>

Linting rules to implement

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in RFC 2119.

MUST:

  • have only one Feature keyword in a file
  • start with Feature name (No other keywords before Feature name except comments and tags)
  • NOT have any invalid lines (lines that don't make sense to the cucumber-js)

SHOULD:

  • have user story
  • have only Given steps in Background
  • have Given or When step as the beginning step
  • have And step in place of repeated steps
  • have Scenario or Scenario Outline description

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.