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

feat(config): support detecting config from project manifest #571

Merged
merged 4 commits into from
Mar 23, 2024

Conversation

orhun
Copy link
Owner

@orhun orhun commented Mar 23, 2024

Description

This PR updates the config detection mechanism to support the following cases:

cliff.toml project manifest (e.g. Cargo.toml) use config from:
cliff.toml
cliff.toml
Cargo.toml
builtin

Also, you don't need to specify the name of the manifest file anymore. So if you configured git-cliff from Cargo.toml, running git cliff is simply enough.

$ echo Cargo.toml | head

[workspace.metadata.git-cliff.changelog]
...
...

$ git cliff

# is same as
$ git cliff --config Cargo.toml

Motivation and Context

closes #568

How Has This Been Tested?

Locally.

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

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.

@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2024

Codecov Report

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

Project coverage is 41.07%. Comparing base (f26fbe0) to head (cd74567).

Files Patch % Lines
git-cliff-core/src/config.rs 40.75% 16 Missing ⚠️
git-cliff/src/lib.rs 0.00% 2 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #571      +/-   ##
==========================================
+ Coverage   41.07%   41.07%   +0.01%     
==========================================
  Files          15       15              
  Lines        1052     1069      +17     
==========================================
+ Hits          432      439       +7     
- Misses        620      630      +10     
Flag Coverage Δ
unit-tests 41.07% <37.94%> (+0.01%) ⬆️

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.

Copy link
Contributor

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this on the project I was working on the other day and it did what I expected and found the config info I had in Cargo.toml without needing to manually add --config Cargo.toml on the command line.

@orhun orhun merged commit 9eb3d65 into main Mar 23, 2024
44 checks passed
@orhun orhun deleted the feat/support_detecting_config_from_manifest branch March 23, 2024 14:32
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.

Detecting default config file should include Cargo.toml
3 participants