Skip to content

Commit

Permalink
feat(conventional): rename message to description
Browse files Browse the repository at this point in the history
  • Loading branch information
pedraal committed Aug 16, 2024
1 parent 6e3dd69 commit d8a3dc1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/releam.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub type ConventionalAttributes {
ConventionalAttributes(
commit_type: CommitType,
scope: Option(String),
message: String,
description: String,
body: List(String),
footer: List(#(String, String)),
breaking: Bool,
Expand All @@ -58,7 +58,7 @@ pub type ConventionalDefinition {
ConventionalDefinition(
commit_type: CommitType,
scope: Option(String),
message: String,
description: String,
breaking: Bool,
)
}
Expand Down Expand Up @@ -169,7 +169,7 @@ pub fn parse_conventional_attributes(message: String) {
ConventionalAttributes(
commit_type: cd.commit_type,
scope: cd.scope,
message: cd.message,
description: cd.description,
body: [],
footer: [],
breaking: cd.breaking,
Expand All @@ -184,7 +184,7 @@ pub fn parse_conventional_attributes(message: String) {
ConventionalAttributes(
commit_type: cd.commit_type,
scope: cd.scope,
message: cd.message,
description: cd.description,
body: cos.body,
footer: cos.footer,
breaking: cd.breaking || cos.breaking,
Expand All @@ -206,18 +206,18 @@ pub fn parse_conventional_definition(def: String) {
|> list.map(string.trim(_))

case attributes {
[commit_type, scope, message] ->
[commit_type, scope, description] ->
Ok(ConventionalDefinition(
commit_type: parse_conventional_commit_type(commit_type),
scope: Some(scope),
message: message,
description: description,
breaking: is_breaking,
))
[commit_type, message] ->
[commit_type, description] ->
Ok(ConventionalDefinition(
commit_type: parse_conventional_commit_type(commit_type),
scope: None,
message: message,
description: description,
breaking: is_breaking,
))
_ -> Error(InvalidCommitDefinition)
Expand Down
10 changes: 5 additions & 5 deletions test/releam_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub fn parse_conventional_definition_test() {
Ok(ConventionalDefinition(
commit_type: Feat,
scope: None,
message: "lorem ipsum",
description: "lorem ipsum",
breaking: False,
)),
)
Expand All @@ -131,7 +131,7 @@ pub fn parse_conventional_definition_test() {
Ok(ConventionalDefinition(
commit_type: Feat,
scope: Some("api"),
message: "lorem ipsum",
description: "lorem ipsum",
breaking: False,
)),
)
Expand All @@ -141,7 +141,7 @@ pub fn parse_conventional_definition_test() {
Ok(ConventionalDefinition(
commit_type: Feat,
scope: Some("api"),
message: "lorem ipsum",
description: "lorem ipsum",
breaking: True,
)),
)
Expand All @@ -151,7 +151,7 @@ pub fn parse_conventional_definition_test() {
Ok(ConventionalDefinition(
commit_type: Feat,
scope: None,
message: "lorem ipsum",
description: "lorem ipsum",
breaking: True,
)),
)
Expand All @@ -161,7 +161,7 @@ pub fn parse_conventional_definition_test() {
Ok(ConventionalDefinition(
commit_type: Custom("foo"),
scope: None,
message: "lorem ipsum",
description: "lorem ipsum",
breaking: False,
)),
)
Expand Down

0 comments on commit d8a3dc1

Please sign in to comment.