Skip to content

Preserving new lines at the end of the template file (fixes #37) - #45

Open
liarco wants to merge 2 commits into
Stuk:mainfrom
liarco:issue-37
Open

Preserving new lines at the end of the template file (fixes #37)#45
liarco wants to merge 2 commits into
Stuk:mainfrom
liarco:issue-37

Conversation

@liarco

@liarco liarco commented Sep 24, 2021

Copy link
Copy Markdown

This PR fixes #37.

Implementation details:

  • the comment parser now returns a third array value with the number of new lines at the end of the given comment
  • the initialization function runs the parser before setting the new lines count and EOL format in order to base its decisions on the template file content (if available)
  • tests have been updated to support the new parser feature and check that both UNIX and Windows EOLs work properly

I hope that this can be useful, please feel free to ask for changes or any further information.

Thank you for your time.

@liarco

liarco commented Sep 30, 2021

Copy link
Copy Markdown
Author

Hi @Stuk, I'm tagging you just to check if this project is still active or not.

Thank you for your time.

@liarco

liarco commented Oct 18, 2021

Copy link
Copy Markdown
Author

Hi @Stuk, I'm sorry to bother you, but do you have any news about this?

@max-kuzmin

max-kuzmin commented Nov 2, 2021

Copy link
Copy Markdown

@Stuk This is really useful feature

@liarco

liarco commented Nov 2, 2021

Copy link
Copy Markdown
Author

Thank you @MaxGsomGsom, unfortunately I'm not receiving any feedback from @Stuk. Maybe he's busy or doesn't have the notifications enabled.

@annkupriyanova

annkupriyanova commented Nov 3, 2021

Copy link
Copy Markdown

Cool feature! Thanks, @liarco

@tonyganchev

tonyganchev commented Oct 24, 2025

Copy link
Copy Markdown

I don't think @Stuk is active with this project in the last few years.

@liarco I am willing to pull this change in [my fork] but since this is a breaking change for existing repos, I'd plan it for v4. Would you file a corresponding issue there so that we can discuss the design to align with other things I want to add?

@tonyganchev

Copy link
Copy Markdown

In addition to the above, the new version I'm working on - 3.2.x is introducing a single-object based config for the rule and it would allow to specify the comment in a header while you define the minimum required empty lines behind it in the config itself - thus no need to keep empty lines in the file.

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.

Unable to specify a new line after a header using a template file

4 participants