Skip to content

Add Gherkin Linting to Megalinter Workflow and Update Implementation#292

Merged
rartych merged 5 commits intocamaraproject:mainfrom
ravindrapalaskar17:Gherkin-linting-Implementation-guideline
Jan 9, 2025
Merged

Add Gherkin Linting to Megalinter Workflow and Update Implementation#292
rartych merged 5 commits intocamaraproject:mainfrom
ravindrapalaskar17:Gherkin-linting-Implementation-guideline

Conversation

@ravindrapalaskar17
Copy link
Copy Markdown
Contributor

@ravindrapalaskar17 ravindrapalaskar17 commented Sep 2, 2024

What type of PR is this?
Close the issue: - #142

Add one of the following kinds:

enhancement/feature
Documentation\

What this PR does / why we need it:
This PR includes the addition of Gherkin linting in the Megalinter workflow to lint the test contribution feature files, along with implementation guideline documentation

Which issue(s) this PR fixes:
Fixes #142

Open Points for Discussion:
Standard Name Length:
The standard name length for features, steps, and scenarios was initially set to 70 characters. However, after testing all feature files, we have adjusted it to 90 for features, 190 for steps, and 190 for scenarios.

List of No-Restricted-Tags:
Review and finalize the list of tags that should be restricted or allowed.

Max-Scenarios-Per-File:
The standard is 15 scenarios per file, but we have increased this limit to 50 scenarios per file.

Keyword Logical Order:
Discuss the logical order of keywords (Given, When, Then, And) and ensure it is consistently enforced.

New Line at EOF:
Decide whether the rule for enforcing a new line at the end of files should be turned on or off.

No-Restricted-Patterns:
Identify and agree on a list of words or patterns that should be avoided in the Feature, Background, and Scenario sections.

File Name Format:
Decide on a standard file naming convention: PascalCase, Title Case, camelCase, kebab-case, or snake_case.

Indentation:
Finalize the indentation standards for Gherkin files (e.g., number of spaces or tabs to use).

…Guidelines (#3)

* Create .gherkin-lintrc

* add gherkin lint in mega linter

* Create Gherkin-linting-implementation-guideline

* Update Gherkin-linting-implementation-guideline

* Update Gherkin-linting-implementation-guideline

* Delete documentation/Gherkin-linting-implementation-guideline

* Update API-linting-Implementation-Guideline.md

* Update API-linting-Implementation-Guideline.md

* fine tune linting rules

* customization of Indentation rule
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Sep 2, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@Kevsy
Copy link
Copy Markdown
Collaborator

Kevsy commented Sep 2, 2024

Nice work @ravindrapalaskar17 !

For the Open Points for Discussion:

  • should each Feature require a description? (I'm not sure if that's covered by 'poor description' from the gherkin-lint docs)

@hdamker
Copy link
Copy Markdown
Collaborator

hdamker commented Sep 2, 2024

Thanks @ravindrapalaskar17!

Regarding:

File Name Format:
Decide on a standard file naming convention: PascalCase, Title Case, camelCase, kebab-case, or snake_case.

Within QualityOnDemand we have currently a mix of kebab-case and camelCase (following the formats of the components of the filename):
<api-name>-<operationId>.feature

cc: @jlurien

@rartych
Copy link
Copy Markdown
Contributor

rartych commented Oct 10, 2024

Regarding:

File Name Format:
Decide on a standard file naming convention: PascalCase, Title Case, camelCase, kebab-case, or snake_case.

Within QualityOnDemand we have currently a mix of kebab-case and camelCase (following the formats of the components of the filename): <api-name>-<operationId>.feature

This format is allowed in API Testing Guidelines
As filename convention (not only casing) can be easily verified I propose to switch this rule off.

@ravindrapalaskar17
Copy link
Copy Markdown
Contributor Author

Nice work @ravindrapalaskar17 !

For the Open Points for Discussion:

  • should each Feature require a description? (I'm not sure if that's covered by 'poor description' from the gherkin-lint docs)

This part is a configuration for the no-restricted-patterns rule, which is applied to various sections of Gherkin feature files. It helps restrict the use of certain terms or patterns in the description, feature, and background sections.
for E.g.
Initial Sample Terms: These are just examples of restricted terms (poor description, validate, verify, etc.), which can be customized or updated as per suggestions from CAMARA.

@PedroDiez
Copy link
Copy Markdown
Contributor

Regarding Indentation:

Indentation:
Finalize the indentation standards for Gherkin files (e.g., number of spaces or tabs to use).

Propose to change: Based on how currently Test inputs are provided

  • Background: 2
  • example: 6

Other comments:
Also agree with this comment

Rest of current configuration proposal seems to work fine:

@ravindrapalaskar17 ravindrapalaskar17 changed the title Add Gherkin Linting to Megalinter Workflow and Update Implementation … Add Gherkin Linting to Megalinter Workflow and Update Implementation Dec 12, 2024
@ravindrapalaskar17 ravindrapalaskar17 marked this pull request as ready for review December 12, 2024 07:17
PedroDiez
PedroDiez previously approved these changes Dec 12, 2024
Copy link
Copy Markdown
Contributor

@PedroDiez PedroDiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

patrice-conil
patrice-conil previously approved these changes Jan 6, 2025
Copy link
Copy Markdown
Contributor

@patrice-conil patrice-conil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rartych rartych dismissed stale reviews from patrice-conil and PedroDiez via 1548016 January 8, 2025 15:43
@rartych
Copy link
Copy Markdown
Contributor

rartych commented Jan 8, 2025

Merge conflicts resolved in documentation file.

@rartych rartych requested a review from PedroDiez January 8, 2025 15:47
Copy link
Copy Markdown
Contributor

@PedroDiez PedroDiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rartych rartych merged commit 303aa2c into camaraproject:main Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linting test definitions

6 participants