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

Extend 'margin-before' / 'margin-after' configuration #58

Closed
2 tasks done
vaclavsvejcar opened this issue Dec 7, 2020 · 1 comment
Closed
2 tasks done

Extend 'margin-before' / 'margin-after' configuration #58

vaclavsvejcar opened this issue Dec 7, 2020 · 1 comment
Assignees
Labels
feature New feature or request
Milestone

Comments

@vaclavsvejcar
Copy link
Owner

vaclavsvejcar commented Dec 7, 2020

⚠️ BREAKING CHANGE: This feature causes breaking change to the YAML configuration.

Checklist

  • Implement the code
  • Change documentation

In current version of Headroom, if margin (empty lines) around generated header is needed, one can use the margin-before and margin-after config properties. These allow to define margin between header and preceding/following code, but aren't applied when header is very first (or very last) thing in the source code. This can cause trouble for example when keeping blank line after header, which is last thing in the file, is required.

In order to make this more flexible, current two configuration options are dropped and replaced by following ones:

  • margin-top-code - defines margin (in no. of empty lines) between generated header and code above it, but only IF header is NOT the first thing in file.
  • margin-top-file - defines margin (in no. of empty lines) between generated header the very top of the file, but only IF header IS the first thing in file.
  • margin-bottom-code - defines margin (in no. of empty lines) between generated header and code below it, but only IF header is NOT the last thing in file.
  • margin-bottom-file - defines margin (in no. of empty lines) between generated header the very end of the file, but only IF header IS the last thing in file.

Examples

                                -- <<< 'margin-top-file' set to '1'
{- some header -}
                               -- <<< 'margin-bottom-code' set to '2'

someFunc :: String
someFunc = undefined
@vaclavsvejcar vaclavsvejcar added the feature New feature or request label Dec 7, 2020
@vaclavsvejcar vaclavsvejcar added this to the v0.4.0.0 milestone Dec 7, 2020
@vaclavsvejcar vaclavsvejcar self-assigned this Dec 7, 2020
vaclavsvejcar added a commit that referenced this issue Dec 7, 2020
@vaclavsvejcar
Copy link
Owner Author

Implemented in master, will be released as par of the v0.4.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant