GithubHelp home page GithubHelp logo

gherkincs's Introduction

Gherkin Code Sniffer

By Juti Noppornpitak

Dependencies

  • twig (dev-master, required for HTML report)

Installation

To use normally, run composer.phar install.

If you plan on developing or extending functionality, run composer.phar install --dev.

Usage

To use this tool, please run php cuke.php [--html <directory_to_put_reports>] <configuration_file_path> <directory_path_to_scan>.

Available Analyzers

Semantic Analyzer

Context Flow

This analyzer first checks for the given-when-then context flow (precondition-action-assertion) in the following patterns:

Precondition
  -> Continuation (as precondition)
  -> Action
  -> Assertion

Action
  -> Continuation (as action)
  -> Assertion

Assertion
  -> Continuation (as assertion)
  -> Precondition
  -> Action

Semantic Quality

It also asserts one of the conditions:

  • any contexts containing "click", "fill", "follow", or "select" is an action,
  • any contexts containing "should" or "must" is an assertion.

When a context does not satisfy two or more conditions, the analyzer will consider it an exception (and emit no warnings).

Coding Style Checker

This analyzer checks if:

  • tab characters are not used,
  • the width of indentation is consistent where the default width is 4 spaces,
  • there exists no trailing spaces,
  • features have no leading spaces (no indentation),
  • backgrounds, scenarios, and scenario outlines have exactly one level of indentation,
  • preconditions, actions, assertions and continuations have exactly two levels of indentation,
  • tabular data has exactly three levels of indentation,
  • tag lines have at most one level of indentation,
  • extra spaces (two or more whitespaces) occur in non-tabular-data contexts.

Instaclick's Coding Style Checker

This analyzer checks if any tags' name must:

  • start with @,
  • start and end with alphanumeric characters,
  • only use hyphens ("-"),
  • be in lowercase.

Write a Custom Analyzer

All analyzers must implement IC\Gherkinics\Analyzer\AnalyzerInterface.

gherkincs's People

Contributors

shiroyuki avatar

Watchers

 avatar

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.