Skip to content

Commit

Permalink
refactor(config): refactor config into a proper module
Browse files Browse the repository at this point in the history
Extracted `models_v1` from `config` for future migration sub-command to `git-cliff`.
  • Loading branch information
Cyclonit committed Mar 17, 2024
1 parent cff6bad commit 14d2f11
Show file tree
Hide file tree
Showing 16 changed files with 530 additions and 367 deletions.
17 changes: 14 additions & 3 deletions git-cliff-core/src/changelog.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::commit::Commit;
use crate::config::Config;
use crate::config::models_v2::{
Config,
};
use crate::error::Result;
#[cfg(feature = "github")]
use crate::github::{
Expand Down Expand Up @@ -307,8 +309,17 @@ impl<'a> Changelog<'a> {
#[cfg(test)]
mod test {
use super::*;
use crate::config::{
Bump, ChangelogConfig, CommitConfig, CommitParser, CommitSortOrder, ReleaseConfig, Remote, RemoteConfig, TagsOrderBy, TextProcessor
use crate::config::models_v2::{
Bump,
ChangelogConfig,
CommitConfig,
CommitParser,
CommitSortOrder,
ReleaseConfig,
Remote,
RemoteConfig,
TagsOrderBy,
TextProcessor,
};
use pretty_assertions::assert_eq;
use regex::Regex;
Expand Down
12 changes: 8 additions & 4 deletions git-cliff-core/src/commit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
use crate::config::{
ChangelogConfig, CommitConfig, CommitParser, LinkParser, TextProcessor
use crate::config::models_v2::{
ChangelogConfig,
CommitConfig,
CommitParser,
LinkParser,
TextProcessor
};
use crate::error::{
Error as AppError,
Expand Down Expand Up @@ -484,10 +488,10 @@ mod test {

#[test]
fn conventional_footers() {
let changelog_config = crate::config::ChangelogConfig {
let changelog_config = crate::config::models_v2::ChangelogConfig {
..Default::default()
};
let commit_config = crate::config::CommitConfig {
let commit_config = crate::config::models_v2::CommitConfig {
parse_conventional_commits: Some(true),
..Default::default()
};
Expand Down
Loading

0 comments on commit 14d2f11

Please sign in to comment.