Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'and' keyword autoformatting #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jdb0123
Copy link
Contributor

@jdb0123 jdb0123 commented Jan 9, 2025

🤔 What's changed?

Update auto formatting to replace sequential equivalent keywords with the And keyword

⚡️ What's your motivation?

New feature

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 Checklist:

  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • Users should know about my change
    • I have added an entry to the "[vNext]" section of the CHANGELOG, linking to this pull request & included my GitHub handle to the release contributors list.

Copy link
Contributor

@gasparnagy gasparnagy left a comment

Choose a reason for hiding this comment

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

Thx. It is generally good and works well - thank you.

I have noted a few smaller issues - see the separate comments for that.

Besides those I have one more request:

Please add a test to the specs project to the Editor/Commands/AutoFormatDocumentCommand.feature file. I have checked and adding this to the end of the file would be fine and enough:

Rule: Auto format should replace repeated keywords with "And"

Scenario: Repeating keywords are replaced with "And"

	Given there is a Reqnroll project scope
	And the following feature file in the editor
		"""
		Feature: Addition

		Scenario: Add two numbers
		    Given I have entered 50 into the calculator
		    Given I have entered 70 into the calculator
			When I add them
			When I check the result
			Then there should be no error
			Then the result should be 120
		"""
	When I invoke the "Auto Format Document" command without waiting for the tag changes
	Then the editor should be updated to
		"""
		Feature: Addition

		Scenario: Add two numbers
		    Given I have entered 50 into the calculator
		    And I have entered 70 into the calculator
		    When I add them
		    And I check the result
		    Then there should be no error
		    And the result should be 120
		"""

@jdb0123 jdb0123 force-pushed the auto_format_keywords branch from e5b8024 to da3ebbe Compare January 24, 2025 12:24
@jdb0123 jdb0123 force-pushed the auto_format_keywords branch from 1ff799f to 15b8379 Compare January 24, 2025 12:57
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.

3 participants