Skip to content

Commit

Permalink
refactor(config)!: refactor option git.filter_commits into `changel…
Browse files Browse the repository at this point in the history
…og.exclude_ungrouped_changes`

Renamed and moved option `git.filter_commits` into `changelog.exclude_ungrouped_changes` for clarity.
Updated description and documentation for option `commit.exclude_ungrouped_changes`.
  • Loading branch information
Cyclonit committed Mar 16, 2024
1 parent 02bc988 commit ecd00a4
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ trim = true
footer_template = """
<!-- generated by git-cliff -->
"""
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ trim = true
footer_template = """
<!-- generated by git-cliff -->
"""
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ trim = true
footer_template = """
<!-- generated by git-cliff -->
"""
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ trim = true
footer_template = """
<!-- generated by git-cliff -->
"""
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ trim = true
footer_template = """
<!-- generated by git-cliff -->
"""
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ trim = true
footer_template = """
<!-- generated by git-cliff -->
"""
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions .github/fixtures/test-keep-a-changelog-links/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ footer_template = """
"""
# remove the leading and trailing whitespace from the templates
trim = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ trim = true
postprocessors = [
{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
]
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -108,8 +110,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "beta|alpha"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions config/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ trim = true
postprocessors = [
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
]
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# # Regex to select git tags that represent releases.
Expand Down Expand Up @@ -86,8 +88,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# # Regex to select git tags that should be excluded from the changelog.
# exclude_tags_pattern = ""
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/cocogitto.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ trim = true
postprocessors = [
{ pattern = '\$REPO', replace = "https://github.com/cocogitto/cocogitto" }, # replace repository URL
]
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -89,8 +91,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/detailed.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ footer_template = """
"""
# remove the leading and trailing whitespace from the templates
trim = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -76,8 +78,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/github-keepachangelog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ footer_template = """
"""
# remove the leading and trailing whitespace from the templates
trim = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -106,8 +108,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/github.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ footer_template = """
"""
# A list of postprocessors using regex to modify the changelog.
postprocessors = []
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -84,8 +86,6 @@ message_preprocessors = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "beta|alpha"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/keepachangelog.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ footer_template = """
"""
# remove the leading and trailing whitespace from the templates
trim = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = true

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -77,8 +79,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = true
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/scoped.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ footer_template = """
"""
# remove the leading and trailing whitespace from the templates
trim = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -67,8 +69,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/scopesorted.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ footer_template = """
"""
# remove the leading and trailing whitespace from the templates
trim = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -80,8 +82,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions examples/unconventional.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ footer_template = """
"""
# remove the leading and trailing whitespace from the templates
trim = true
# Whether to exclude changes that do not belong to any group from the changelog.
exclude_ungrouped_changes = false

[release]
# Regex to select git tags that represent releases.
Expand Down Expand Up @@ -65,8 +67,6 @@ commit_parsers = [
]
# Whether to prevent breaking changes from being excluded by commit parsers.
retain_breaking_changes = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# Regex to select git tags that should be excluded from the changelog.
exclude_tags_pattern = "v0.1.0-beta.1"
# Whether to order commits newest to oldest or oldest to newest in their group.
Expand Down
4 changes: 2 additions & 2 deletions git-cliff-core/src/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl<'a> Changelog<'a> {
vec![commit]
}
})
.filter_map(|commit| match commit.process(&self.config.commit) {
.filter_map(|commit| match commit.process(&self.config.changelog, &self.config.commit) {
Ok(commit) => Some(commit),
Err(e) => {
trace!(
Expand Down Expand Up @@ -346,6 +346,7 @@ mod test {
replace: Some(String::from("exciting")),
replace_command: None,
}]),
exclude_ungrouped_changes: Some(false),
},
release: ReleaseConfig {
tags_pattern: None,
Expand Down Expand Up @@ -477,7 +478,6 @@ mod test {
},
]),
retain_breaking_changes: None,
filter_commits: Some(false),
exclude_tags_pattern: Regex::new("v3.*").ok(),
sort_order: Some(String::from("oldest")),
link_parsers: None,
Expand Down
Loading

0 comments on commit ecd00a4

Please sign in to comment.