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

fix(args): allow -o and -p together if they point to different files #653

Merged
merged 3 commits into from
May 26, 2024

Conversation

antonengelhardt
Copy link
Sponsor Contributor

@antonengelhardt antonengelhardt commented May 24, 2024

setting prepend and output together will ignore the prepend flag

Description

  • preprend and output flags are conflicting and should only be used together if they point to different paths

Motivation and Context

orhun/git-cliff-action#21 (comment)

How Has This Been Tested?

I build it locally and tested it with one of my rust projects

Screenshots / Logs (if applicable)

Screenshot-Visual Studio Code-007271

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (no code change)
  • Refactor (refactoring production code)
  • Other

not sure

Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have formatted the code with rustfmt.
  • I checked the lints with clippy.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

welcome bot commented May 24, 2024

Thanks for opening this pull request! Please check out our contributing guidelines! ⛰️

setting prepend and output together will ignore the prepend flag

Signed-off-by: Anton Engelhardt <antoncengelhardt@icloud.com>
@codecov-commenter
Copy link

codecov-commenter commented May 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 41.65%. Comparing base (dd538c8) to head (3b81a56).
Report is 2 commits behind head on main.

Files Patch % Lines
git-cliff/src/lib.rs 0.00% 4 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #653      +/-   ##
==========================================
- Coverage   41.90%   41.65%   -0.24%     
==========================================
  Files          15       15              
  Lines        1079     1083       +4     
==========================================
- Hits          452      451       -1     
- Misses        627      632       +5     
Flag Coverage Δ
unit-tests 41.65% <0.00%> (-0.24%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

website/docs/usage/args.md Outdated Show resolved Hide resolved
… arg

Signed-off-by: Anton Engelhardt <antoncengelhardt@icloud.com>
@antonengelhardt
Copy link
Sponsor Contributor Author

@orhun i ticked that this is a breaking change. Not sure though. WDYT?

@orhun
Copy link
Owner

orhun commented May 26, 2024

Ah, I found an issue: #120

It turns out someone actually requested this feature in the past, so I'm a bit unsure about merging this :/

I think we can bring back the note in the git-cliff-action repo instead. What do you think?

@antonengelhardt
Copy link
Sponsor Contributor Author

Yeah, I get your point.

In my opinion, output and prepend should work together, but only if the file paths are not equal.

If the file paths are the same, it does not make sense to use both flags and an error should be shown.

Do you agree?

@orhun
Copy link
Owner

orhun commented May 26, 2024

Actually yes, that sounds more reasonable!

@antonengelhardt
Copy link
Sponsor Contributor Author

Any idea for the error message?

@orhun
Copy link
Owner

orhun commented May 26, 2024

Something along the lines of "Output files cannot be the same" maybe

Signed-off-by: Anton Engelhardt <antoncengelhardt@icloud.com>
@antonengelhardt antonengelhardt changed the title fix(args): -o and -p are not allowed together fix(args): -o and -p are only allowed together if they point to different files May 26, 2024
@orhun
Copy link
Owner

orhun commented May 26, 2024

Awesome, thanks!

@orhun orhun changed the title fix(args): -o and -p are only allowed together if they point to different files fix(args): allow -o and -p together if they point to different files May 26, 2024
@orhun orhun merged commit 076f859 into orhun:main May 26, 2024
44 checks passed
Copy link

welcome bot commented May 26, 2024

Congrats on merging your first pull request! ⛰️

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