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

[Transformer] Fix sections order #70

Closed
adrszad opened this issue May 19, 2021 · 5 comments · Fixed by #74
Closed

[Transformer] Fix sections order #70

adrszad opened this issue May 19, 2021 · 5 comments · Fixed by #74
Assignees
Milestone

Comments

@adrszad
Copy link
Contributor

adrszad commented May 19, 2021

Fix sections order.
This could also support merging sections if they're defined more than once in a file, e.g.:

*** Keywords ***
Keyword 1
*** Test Cases ***
Test 1
*** Keywords ***
Keyword 2

Should be changed to:

*** Test Cases ***
Test 1
*** Keywords ***
Keyword 1
Keyword 2

@bhirsz bhirsz self-assigned this May 29, 2021
@bhirsz
Copy link
Member

bhirsz commented May 29, 2021

Good idea :) I will take a shot into implementing this.

@bhirsz
Copy link
Member

bhirsz commented May 29, 2021

Thought: there could be different method of naming the section (*** Keyowrd *** vs *** Keywords *** vs ***keyword*). When merging I will just pick first encountered name. This name should be normalized by NormalizeSectionHeaderName later on.

@bhirsz
Copy link
Member

bhirsz commented May 29, 2021

Also lines before first section are comments, so it should go to ``***Comments *** section:

some general comment

*** Settings ***
Library   Stuff

to

*** Comments ***
some general comment

*** Settings ***
Library   Stuff

@bhirsz
Copy link
Member

bhirsz commented May 30, 2021

Additional note: I will also need to handle possible comments:

*** Test Case ***  i am comment
*** Test Case ***
*** Test Cases ***  yet again so comment   and here

There are following ways to deal with them:

  1. just remove them but print the warning message
  2. merge them
  3. merge unique ones
  4. keep only first encountered and warn on the rest

It could be also possible to use parameter so others can decide what they're doing with section comments.

@bhirsz
Copy link
Member

bhirsz commented May 30, 2021

I linked WIP PR. Regarding last comment I went with 4) (I'm keeping only the header comments from the first section of the same type).

@bhirsz bhirsz closed this as completed in #74 Jun 2, 2021
@bhirsz bhirsz added this to the 1.2.0 milestone Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants