Skip to content

Commit

Permalink
Merge pull request #21 from laser-zentrale-de/commitlint
Browse files Browse the repository at this point in the history
Commitlint
  • Loading branch information
d-strobel authored Nov 12, 2024
2 parents 9178291 + f1f471b commit e81a3a7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 27 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
name: build

on:
push:
paths:
- "**.rs"
- "Cargo.toml"
- "Cargo.lock"
pull_request:
branches: ["main"]

Expand Down
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
default_install_hook_types: [pre-commit, commit-msg]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.16.0
hooks:
- id: commitlint
additional_dependencies: ["@commitlint/config-conventional"]
stages: ["commit-msg"]
6 changes: 6 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
extends: [ '@commitlint/config-conventional'],
rules: {
'body-max-line-length': [1, 'always', 200],
}
};
14 changes: 4 additions & 10 deletions src/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use std::fs::File;

#[derive(Deserialize, Debug)]
pub struct Entry {
#[serde(rename = "#")]
pub number: String,
#[serde(rename = "Name")]
pub name: String,
//#[serde(rename = "#")]
//pub number: String,
//#[serde(rename = "Name")]
//pub name: String,
#[serde(rename = "Start")]
pub start: String,
}
Expand Down Expand Up @@ -57,14 +57,8 @@ mod tests {
assert!(result.is_ok());
let entries = result.unwrap();
assert_eq!(entries.len(), 3);
assert_eq!(entries[0].number, "M1");
assert_eq!(entries[0].name, "Vocals");
assert_eq!(entries[0].start, "00:00:01:23");
assert_eq!(entries[1].number, "M2");
assert_eq!(entries[1].name, "First Drop");
assert_eq!(entries[1].start, "1:03:55:02");
assert_eq!(entries[2].number, "M3");
assert_eq!(entries[2].name, "Second Drop");
assert_eq!(entries[2].start, "10:43:20:01");
}
}
12 changes: 0 additions & 12 deletions src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,9 @@ mod tests {
// Define some test entries
let entries = vec![
Entry {
number: "M1".to_string(),
name: "Vocals".to_string(),
start: "1:10:10:04".to_string(),
},
Entry {
number: "M1".to_string(),
name: "Drop".to_string(),
start: "1:10:10:20".to_string(),
},
];
Expand Down Expand Up @@ -299,13 +295,9 @@ mod tests {
// Define some test entries
let entries = vec![
Entry {
number: "M1".to_string(),
name: "Vocals".to_string(),
start: "1:10:10:04".to_string(),
},
Entry {
number: "M1".to_string(),
name: "Drop".to_string(),
start: "1:10:10:20".to_string(),
},
];
Expand Down Expand Up @@ -343,13 +335,9 @@ mod tests {
// Define some test entries
let entries = vec![
Entry {
number: "M1".to_string(),
name: "Vocals".to_string(),
start: "1:10:10:04".to_string(),
},
Entry {
number: "M1".to_string(),
name: "Drop".to_string(),
start: "1:10:10:20".to_string(),
},
];
Expand Down

0 comments on commit e81a3a7

Please sign in to comment.