From 231aae2920a81683c27bd5e4a901a7a363c26d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Sun, 11 Jun 2023 22:26:45 +0200 Subject: [PATCH] style(config): apply formatting to config files (#238) --- .cz.toml | 8 ++--- .markdownlint.yaml | 2 ++ Makefile.toml | 74 ++++++++++++++++++++-------------------------- cliff.toml | 37 +++++++++++------------ committed.toml | 16 ++++++++-- rustfmt.toml | 2 ++ typos.toml | 2 ++ 7 files changed, 74 insertions(+), 67 deletions(-) diff --git a/.cz.toml b/.cz.toml index 62d06ff4..5e0ab260 100644 --- a/.cz.toml +++ b/.cz.toml @@ -1,3 +1,5 @@ +# configuration for https://github.com/commitizen/cz-cli + [tool.commitizen] name = "cz_customize" tag_format = "$version" @@ -7,7 +9,6 @@ update_changelog_on_bump = true major_version_zero = true use_shortcuts = true - [tool.commitizen.customize] message_template = """{{change_type}}({{scope}}): {{subject}} @@ -32,7 +33,7 @@ type = "list" name = "change_type" choices = [ { value = "build", name = "build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)", key = "b" }, - { value = "chore", name = "chore: A modification that generally does not fall into any other category", key = "c"}, + { value = "chore", name = "chore: A modification that generally does not fall into any other category", key = "c" }, { value = "ci", name = "ci: Changes to our CI configuration files and scripts (example scopes: GitLabCI)", key = "i" }, { value = "docs", name = "docs: Documentation only changes", key = "d" }, { value = "feat", name = "feat: A new feature.", key = "f" }, @@ -41,7 +42,7 @@ choices = [ { value = "refactor", name = "refactor: A code change that neither fixes a bug nor adds a feature", key = "r" }, { value = "revert", name = "revert: Revert previous commits", key = "v" }, { value = "style", name = "style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", key = "s" }, - { value = "test", name = "test: Adding missing or correcting existing tests", key = "t" } + { value = "test", name = "test: Adding missing or correcting existing tests", key = "t" }, ] message = "Select the type of change you are committing" @@ -75,4 +76,3 @@ default = false type = "input" name = "footer" message = "Footer. Information about Breaking Changes and reference issues that this commit closes: (press [enter] to skip)" - diff --git a/.markdownlint.yaml b/.markdownlint.yaml index fc7fa56c..72c45c3e 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,3 +1,5 @@ +# configuration for https://github.com/DavidAnson/markdownlint + no-inline-html: allowed_elements: - img diff --git a/Makefile.toml b/Makefile.toml index 3077c9a6..b49c5379 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,49 +1,51 @@ +# configuration for https://github.com/sagiegurari/cargo-make + [config] skip_core_tasks = true [tasks.ci] run_task = [ - { name = "ci-unix", condition = { platforms = ["linux", "mac"] } }, - { name = "ci-windows", condition = { platforms = ["windows"] } }, + { name = "ci-unix", condition = { platforms = [ + "linux", + "mac", + ] } }, + { name = "ci-windows", condition = { platforms = [ + "windows", + ] } }, ] [tasks.ci-unix] private = true dependencies = [ - "fmt", - "check-crossterm", - "check-termion", - "check-termwiz", - "test-crossterm", - "test-termion", - "test-termwiz", - "clippy-crossterm", - "clippy-termion", - "clippy-termwiz", - "test-doc", + "fmt", + "check-crossterm", + "check-termion", + "check-termwiz", + "test-crossterm", + "test-termion", + "test-termwiz", + "clippy-crossterm", + "clippy-termion", + "clippy-termwiz", + "test-doc", ] [tasks.ci-windows] private = true dependencies = [ - "fmt", - "check-crossterm", - "check-termwiz", - "test-crossterm", - "test-termwiz", - "clippy-crossterm", - "clippy-termwiz", - "test-doc", + "fmt", + "check-crossterm", + "check-termwiz", + "test-crossterm", + "test-termwiz", + "clippy-crossterm", + "clippy-termwiz", + "test-doc", ] [tasks.fmt] command = "cargo" -args = [ - "fmt", - "--all", - "--", - "--check", -] +args = ["fmt", "--all", "--", "--check"] [tasks.check-crossterm] env = { TUI_FEATURES = "serde,crossterm" } @@ -144,29 +146,17 @@ args = [ [tasks.test-doc] command = "cargo" -args = [ - "test", - "--doc", -] +args = ["test", "--doc"] [tasks.run-example] private = true condition = { env_set = ["TUI_EXAMPLE_NAME"] } command = "cargo" -args = [ - "run", - "--release", - "--example", - "${TUI_EXAMPLE_NAME}" -] +args = ["run", "--release", "--example", "${TUI_EXAMPLE_NAME}"] [tasks.build-examples] command = "cargo" -args = [ - "build", - "--examples", - "--release" -] +args = ["build", "--examples", "--release"] [tasks.run-examples] dependencies = ["build-examples"] diff --git a/cliff.toml b/cliff.toml index 51c4871a..05658ed6 100644 --- a/cliff.toml +++ b/cliff.toml @@ -1,5 +1,4 @@ -# configuration file for git-cliff -# see https://github.com/orhun/git-cliff#configuration-file +# configuration for https://github.com/orhun/git-cliff [changelog] # changelog header @@ -47,29 +46,29 @@ filter_unconventional = true split_commits = false # regex for preprocessing the commit messages commit_preprocessors = [ - { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/tui-rs-revival/ratatui/issues/${2}))"}, + { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/tui-rs-revival/ratatui/issues/${2}))" }, { pattern = '(better safe shared layout cache)', replace = "perf(layout): ${1}" }, { pattern = '(Clarify README.md)', replace = "docs(readme): ${1}" }, { pattern = '(Update README.md)', replace = "docs(readme): ${1}" }, - { pattern = '(fix typos|Fix typos)', replace = "fix: ${1}" } + { pattern = '(fix typos|Fix typos)', replace = "fix: ${1}" }, ] # regex for parsing and grouping commits commit_parsers = [ - { message = "^feat", group = "Features"}, - { message = "^[fF]ix", group = "Bug Fixes"}, - { message = "^refactor", group = "Refactor"}, - { message = "^doc", group = "Documentation"}, - { message = "^perf", group = "Performance"}, - { message = "^style", group = "Styling"}, - { message = "^test", group = "Testing"}, - { message = "^chore\\(release\\): prepare for", skip = true}, - { message = "^chore\\(pr\\)", skip = true}, - { message = "^chore\\(pull\\)", skip = true}, - { message = "^chore", group = "Miscellaneous Tasks"}, - { body = ".*security", group = "Security"}, - { message = "^build", group = "Build"}, - { message = "^ci", group = "Continuous Integration"}, - { message = "^revert", group = "Reverted Commits"}, + { message = "^feat", group = "Features" }, + { message = "^[fF]ix", group = "Bug Fixes" }, + { message = "^refactor", group = "Refactor" }, + { message = "^doc", group = "Documentation" }, + { message = "^perf", group = "Performance" }, + { message = "^style", group = "Styling" }, + { message = "^test", group = "Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore", group = "Miscellaneous Tasks" }, + { body = ".*security", group = "Security" }, + { message = "^build", group = "Build" }, + { message = "^ci", group = "Continuous Integration" }, + { message = "^revert", group = "Reverted Commits" }, ] # protect breaking changes from being skipped due to matching a skipping commit_parser protect_breaking_commits = false diff --git a/committed.toml b/committed.toml index a380f5c2..aa7df8e7 100644 --- a/committed.toml +++ b/committed.toml @@ -1,7 +1,7 @@ # configuration for https://github.com/crate-ci/committed # https://www.conventionalcommits.org -style="conventional" +style = "conventional" # disallow merge commits merge_commit = false # subject is not required to be capitalized @@ -15,4 +15,16 @@ line_length = 0 # disable subject length subject_length = 0 # default allowed_types [ "chore", "docs", "feat", "fix", "perf", "refactor", "style", "test" ] -allowed_types = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test" ] +allowed_types = [ + "build", + "chore", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", +] diff --git a/rustfmt.toml b/rustfmt.toml index 7674fe72..c5e57a1b 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,2 +1,4 @@ +# configuration for https://rust-lang.github.io/rustfmt/ + wrap_comments = true comment_width = 100 diff --git a/typos.toml b/typos.toml index 372dc952..619c0c80 100644 --- a/typos.toml +++ b/typos.toml @@ -1,2 +1,4 @@ +# configuration for https://github.com/crate-ci/typos + [default.extend-words] ratatui = "ratatui"