From 1ddbe21e7deb3fdc4e019cce7c369e7e8d149dfe Mon Sep 17 00:00:00 2001 From: Danny Tatom Date: Sun, 1 May 2022 11:44:37 -0700 Subject: [PATCH] chore(docs): remove extra config examples --- README.md | 4 +- .../{koji-default.toml => default.toml} | 0 meta/config/koji-gitmoji.toml | 54 ------------------- meta/config/koji-no-emoji.toml | 43 --------------- src/lib/config.rs | 10 +--- 5 files changed, 3 insertions(+), 108 deletions(-) rename meta/config/{koji-default.toml => default.toml} (100%) delete mode 100644 meta/config/koji-gitmoji.toml delete mode 100644 meta/config/koji-no-emoji.toml diff --git a/README.md b/README.md index 2f398aa..8c58292 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ Config files are prioritized in the following order: - Passed in via `--config` - `.koji.toml` in the working directory - `~/.config/koji/config.toml` -- The [default](https://github.com/its-danny/koji/blob/main/meta/config/koji-default.toml) config +- The [default](https://github.com/its-danny/koji/blob/main/meta/config/default.toml) config ### Options @@ -127,7 +127,7 @@ autocomplete = true - Type: `Vec` - Optional: `true` -- Description: A list of commit types to use instead of the [default](https://github.com/its-danny/koji/blob/main/meta/config/koji-default.toml). +- Description: A list of commit types to use instead of the [default](https://github.com/its-danny/koji/blob/main/meta/config/default.toml). ```toml [[commit_types]] name = "feat" diff --git a/meta/config/koji-default.toml b/meta/config/default.toml similarity index 100% rename from meta/config/koji-default.toml rename to meta/config/default.toml diff --git a/meta/config/koji-gitmoji.toml b/meta/config/koji-gitmoji.toml deleted file mode 100644 index 24b5063..0000000 --- a/meta/config/koji-gitmoji.toml +++ /dev/null @@ -1,54 +0,0 @@ -[[commit_types]] -name = "feat" -emoji = "โœจ" -description = "A new feature" - -[[commit_types]] -name = "fix" -emoji = "๐Ÿ›" -description = "A bug fix" - -[[commit_types]] -name = "docs" -emoji = "๐Ÿ“" -description = "Documentation only changes" - -[[commit_types]] -name = "style" -emoji = "๐Ÿ’„" -description = "Changes that do not affect the meaning of the code" - -[[commit_types]] -name = "refactor" -emoji = "โ™ป๏ธ" -description = "A code change that neither fixes a bug nor adds a feature" - -[[commit_types]] -name = "perf" -emoji = "โšก" -description = "A code change that improves performance" - -[[commit_types]] -name = "test" -emoji = "โœ…" -description = "Adding missing tests or correcting existing tests" - -[[commit_types]] -name = "build" -emoji = "๐Ÿ“ฆ" -description = "Changes that affect the build system or external dependencies" - -[[commit_types]] -name = "ci" -emoji = "๐Ÿ‘ท" -description = "Changes to our CI configuration files and scripts" - -[[commit_types]] -name = "chore" -emoji = "๐Ÿงน" -description = "Other changes that don't modify src or test files" - -[[commit_types]] -name = "revert" -emoji = "โช" -description = "Reverts a previous commit" diff --git a/meta/config/koji-no-emoji.toml b/meta/config/koji-no-emoji.toml deleted file mode 100644 index 25fdd0d..0000000 --- a/meta/config/koji-no-emoji.toml +++ /dev/null @@ -1,43 +0,0 @@ -[[commit_types]] -name = "feat" -description = "A new feature" - -[[commit_types]] -name = "fix" -description = "A bug fix" - -[[commit_types]] -name = "docs" -description = "Documentation only changes" - -[[commit_types]] -name = "style" -description = "Changes that do not affect the meaning of the code" - -[[commit_types]] -name = "refactor" -description = "A code change that neither fixes a bug nor adds a feature" - -[[commit_types]] -name = "perf" -description = "A code change that improves performance" - -[[commit_types]] -name = "test" -description = "Adding missing tests or correcting existing tests" - -[[commit_types]] -name = "build" -description = "Changes that affect the build system or external dependencies" - -[[commit_types]] -name = "ci" -description = "Changes to our CI configuration files and scripts" - -[[commit_types]] -name = "chore" -description = "Other changes that don't modify src or test files" - -[[commit_types]] -name = "revert" -description = "Reverts a previous commit" diff --git a/src/lib/config.rs b/src/lib/config.rs index 6ddda82..edcea22 100644 --- a/src/lib/config.rs +++ b/src/lib/config.rs @@ -16,7 +16,7 @@ pub struct Config { /// Find a config and load it. pub fn load_config(path: Option) -> Result { // Get the default config - let default_str = include_str!("../../meta/config/koji-default.toml"); + let default_str = include_str!("../../meta/config/default.toml"); let default_config: Config = toml::from_str(default_str).context("could not parse config file")?; @@ -69,12 +69,4 @@ mod tests { assert_eq!(first.description, "A new feature"); } - - #[test] - fn test_load_config_with_arg() { - let config = load_config(Some("./meta/config/koji-no-emoji.toml".into())).unwrap(); - let first = config.commit_types.get(0).unwrap(); - - assert_eq!(first.emoji, None); - } }