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

Various imrpovements - replace mode, specifing exact config location … #34

Merged
merged 1 commit into from
May 18, 2020

Conversation

nvlbg
Copy link
Contributor

@nvlbg nvlbg commented May 13, 2020

…and more

List of changes introduces:

  • config structure is changed a bit to support the use case of
    specifing exact path of file and replace mode markers. This
    can be considered a breaking change and that's why I bumped
    the version as well (semantic versioning).
  • updated the README with the introduced changes from user perspective
  • implemented replace mode where only part of a file is replaced
    instead of rewriting the entire file
  • implemented expanding of ~ for user's home directory
  • removed code for append mode - in my opinion this is a useless
    mode since the operation is not idempotent. The same result should
    be achievable with replace mode.
  • refactored some of the code with improved error handling
  • added testdata/output* files in .gitignore - these files are used
    only temporary during test execution and don't need to be tracked

…and more

List of changes introduces:
 - config structure is changed a bit to support the use case of
   specifing exact path of file and replace mode markers. This
   can be considered a breaking change and that's why I bumped
   the version as well (semantic versioning).
 - updated the README with the introduced changes from user perspective
 - implemented replace mode where only part of a file is replaced
   instead of rewriting the entire file
 - removed code for append mode - in my opinion this is a useless
   mode since the operation is not idempotent. The same result should
   be achievable with replace mode.
 - refactored some of the code with improved error handling
 - added testdata/output* files in .gitignore - these files are used
   only temporary during test execution and don't need to be tracked
@nvlbg
Copy link
Contributor Author

nvlbg commented May 13, 2020

Hi! First of all, great project. It's the closest thing I could find for my base16 needs. However there is some missing functionality that I need and looking through the issues I can see that other people have stumbled upon the same things.

This pull request should close #16 #29 and #33

@codecov
Copy link

codecov bot commented May 13, 2020

Codecov Report

Merging #34 into master will increase coverage by 5.58%.
The diff coverage is 32.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
+ Coverage   12.46%   18.05%   +5.58%     
==========================================
  Files           5        5              
  Lines         353      421      +68     
==========================================
+ Hits           44       76      +32     
- Misses        302      324      +22     
- Partials        7       21      +14     
Impacted Files Coverage Δ
main.go 0.95% <0.00%> (-0.35%) ⬇️
helpers.go 41.79% <57.14%> (+17.05%) ⬆️
config.go 42.42% <100.00%> (-1.70%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9b6b43...4b76f99. Read the comment docs.

@pinpox
Copy link
Owner

pinpox commented May 18, 2020

Thanks for the PR and sorry for the delay merging!

I'm a bit busy at the moment, but PRs are very welcome

@pinpox pinpox merged commit d190d4c into pinpox:master May 18, 2020
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.

2 participants