
Security News
AI Slop Is Polluting Bug Bounty Platforms with Fake Vulnerability Reports
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
io.cucumber:gherkin-utils
Advanced tools
Gherkin utils for doing things such as walking a Gherkin tree or pretty printing Gherkin files.
This library is a set of utilities to work with Gherkin documents and AST.
The command-line tool can be used to format .feature
files or translate .feature
files
into .feature.md
files.
Example usage:
# Translate all `.feature` files to `.feature.md` files and delete the `.feature` files.
# See https://github.com/cucumber/common/blob/main/gherkin/MARKDOWN_WITH_GHERKIN.md
# Note that the globs must be quoted to prevent the shell from expanding the globs.
npx @cucumber/gherkin-utils format --move "features/**/*.feature" "features/**/*.feature.md"
More details:
npx @cucumber/gherkin-utils --help
This module can also be used as a library. It provides two main utilities, pretty
and gherkinDocumentWalker
.
This function takes a GherkinDocument as input and returns a pretty-printed representation in Gherkin or Markdown.
The GherkinDocumentWalker is a class for walking and filtering the AST produced by Gherkin after parsing a feature file.
When running walkGherkinDocument
on a GherkinDocument, it will produce a deep copy of the object.
It takes two arguments upon creation:
Filtering keeps the meaning of the original GherkinDocument, which means:
Background
was present, it will always be in the Feature
(or Rule
)By default, all elements are accepted, which means that if you want to do filtering you should reject all other elements. To ease this, we also provide the rejectAllFilters
.
Here's an example:
import { GherkinDocumentWalker, rejectAllFilters } from '@cucumber/gherkin-utils'
// Only keeps scenarios which name include 'magic'
const filter = new GherkinDocumentWalker({
...rejectAllFilters,
...{ acceptScenario: (scenario) => scenario.name.includes('magic') },
})
// Makes a list with all the scenario names
const allScenarioNames: string[] = []
const scenarioNameFinder = new GherkinDocumentWalker({}, {
handleScenario: (scenario) => allScenarioNames.push(scenario.name),
})
FAQs
Gherkin utils for doing things such as walking a Gherkin tree or pretty printing Gherkin files.
We found that io.cucumber:gherkin-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Research
Security News
The Socket Research team investigates a malicious Python package disguised as a Discord error logger that executes remote commands and exfiltrates data via a covert C2 channel.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.