GithubHelp home page GithubHelp logo

funkwerk / gherkin_lint Goto Github PK

View Code? Open in Web Editor NEW
39.0 4.0 14.0 181 KB

Lints gherkin files

License: MIT License

Ruby 48.15% Gherkin 51.85%
gherkin bdd lint feature cucumber specification-by-example best-practices

gherkin_lint's Introduction

Lint Gherkin Files

Build Status Build status Code Climate Docker Build Downloads Latest Tag

This tool lints gherkin files.

Usage

run gherkin_lint on a list of files

gherkin_lint -f '<wild_card_path>' #default is `features/**/*.feature`

With --disable CHECK or --enable CHECK it's possible to disable respectivly enable program wide checks except when a linter requires additional values to be set in order to be valid. Currently only RequiredTagStartsWith meets this criteria.

Checks could be disabled using tags within Feature Files. To do so, add @disableCHECK. Detailed usage within the disable_tags feature.

Usage with Docker

Assuming there are feature files in the current directory. Then call.

docker run -ti -v $(pwd):/src -w /src gherkin/lint *.feature

This will mount the current directory within the Gherkin Lint Docker Container and then check all feature files.

Checks

Errors and Warnings

There are errors and warnings.

Warnings

Warnings are for issues that do not influence the returncode. These issues are also for introducing new checks. These new checks will stay some releases as warning and will be later declared as error, to give users the possibility to adapt their codebase.

Errors

If there is at least one error, the returncode will be set to ERROR (!= 0).

Installation

Install it with:

sudo gem install gherkin_lint

After that gherkin_lint executable is available.

Configuration

If you have a custom configuration you'd like to run on a regular basis instead of passing enable and disable flags through the CLI on every run, you can configure a .gherkin_lint.yml file that will be loaded on execution. The format and available linters are in config/default.yml

gherkin_lint's People

Contributors

cberizko avatar enkessler avatar johngluckmdsol avatar lindt avatar nagarwal-mdsol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gherkin_lint's Issues

Project fork needed

Because

  1. There is community support to continue developing this project
  2. The only person with merge/release/etc. permission (i.e. @lindt ) is no longer available

there is a need to fork this project.

So, @johngluckmdsol , @mnohai-mdsol, and anyone else with an opinion: where will the fork be?

Configurable rules

We'd like to submit a PR for your gem that will allow us to configure your gem with custom rules. We'd do something like the following

  1. Create a configuration file (.gherkin_lint) to set the name of additional directories to read rules from (this would be lib/gherkin_lint/linter).
  2. Make GherkinLint.LINTER dynamic (no longer a constant) and read a glob based on the directories in the configuration
  3. Remove the --enable option. All directories would be included and then --disable would be processed. I'm not clear why the --enable option is necessary.

What do you think?

Project not building on Windows

I was interested in playing around with this gem but I develop primarily on a Windows machine and this project does not seem to work on it. It looks like that is because you test with Aruba and Aruba does not (currently) work on Windows. Even with an unreleased Aruba fix, about half of the tests fail because of line endings. I might attempt to fix all of this myself in the near future.

Verbose success

If there are no linters enabled or if the linters run and find nothing, gherkin_lint currently does nothing but it should say something like "No Linters were enabled" or "gherkin lint found no errors"

gherkin_lint breaks binding.pry

We use pry and the binding.pry expression to debug our cucumber/step definitions.

When we added the gherkin_lint gem to our Gemfile (ruby 2.0,0, cucumber 1.3.17), binding.pry fails with:
wrong number of arguments (0 for 1..2) (ArgumentError).
Removing the gem solved the problem.

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.