From 6723af6dddc675465c496b52b7f2c0a4da6cc46c Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Tue, 14 May 2024 10:10:55 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Add=20option=20for=20Ind?= =?UTF-8?q?entation=20length?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Option Indentation now available to set the indentation length of the many linters and formatters. ✅ Closes: #44 --- CHANGELOG.md | 4 ++++ copier.yml | 5 +++++ .../{.JuliaFormatter.toml => .JuliaFormatter.toml.jinja} | 2 +- template/{.editorconfig => .editorconfig.jinja} | 2 +- template/{.markdownlint.json => .markdownlint.json.jinja} | 2 +- ....pre-commit-config.yaml => .pre-commit-config.yaml.jinja} | 2 +- template/.yamllint.yml | 2 -- template/.yamllint.yml.jinja | 2 ++ test/runtests.jl | 1 + 9 files changed, 16 insertions(+), 6 deletions(-) rename template/{.JuliaFormatter.toml => .JuliaFormatter.toml.jinja} (86%) rename template/{.editorconfig => .editorconfig.jinja} (83%) rename template/{.markdownlint.json => .markdownlint.json.jinja} (83%) rename template/{.pre-commit-config.yaml => .pre-commit-config.yaml.jinja} (96%) delete mode 100644 template/.yamllint.yml create mode 100644 template/.yamllint.yml.jinja diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dece013..46068479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning]. ## [Unreleased] +### Added + +- Add Indentation option (#44) + ### Fixed - Coverage now checks main branch (#65) diff --git a/copier.yml b/copier.yml index 013ec885..9a45aeee 100644 --- a/copier.yml +++ b/copier.yml @@ -34,6 +34,11 @@ License: - MIT - MPL-2.0 +Indentation: + type: int + help: Indentation for JuliaForm + validator: "{% if Indentation <= 0 %}Indentation must be positive{% endif %}" + AddMacToCI: type: bool help: Add macos on CI? diff --git a/template/.JuliaFormatter.toml b/template/.JuliaFormatter.toml.jinja similarity index 86% rename from template/.JuliaFormatter.toml rename to template/.JuliaFormatter.toml.jinja index bee44f1a..8baf3862 100644 --- a/template/.JuliaFormatter.toml +++ b/template/.JuliaFormatter.toml.jinja @@ -1,5 +1,5 @@ annotate_untyped_fields_with_any = false -indent = 2 +indent = {{ Indentation }} margin = 100 normalize_line_endings = "unix" remove_extra_newlines = true diff --git a/template/.editorconfig b/template/.editorconfig.jinja similarity index 83% rename from template/.editorconfig rename to template/.editorconfig.jinja index 9f5c55fc..883db433 100644 --- a/template/.editorconfig +++ b/template/.editorconfig.jinja @@ -5,6 +5,6 @@ root = true end_of_line = lf insert_final_newline = true charset = utf-8 -indent_size = 2 +indent_size = {{ Indentation }} indent_style = space trim_trailing_whitespace = true diff --git a/template/.markdownlint.json b/template/.markdownlint.json.jinja similarity index 83% rename from template/.markdownlint.json rename to template/.markdownlint.json.jinja index 8bf958ad..a04da0d7 100644 --- a/template/.markdownlint.json +++ b/template/.markdownlint.json.jinja @@ -1,6 +1,6 @@ { "MD007": { - "indent": 2, + "indent": {{ Indentation }}, "start_indented": false }, "MD013": { diff --git a/template/.pre-commit-config.yaml b/template/.pre-commit-config.yaml.jinja similarity index 96% rename from template/.pre-commit-config.yaml rename to template/.pre-commit-config.yaml.jinja index 49f1c39c..ab717173 100644 --- a/template/.pre-commit-config.yaml +++ b/template/.pre-commit-config.yaml.jinja @@ -21,7 +21,7 @@ repos: args: [--fix=lf] - id: no-commit-to-branch - id: pretty-format-json - args: [--autofix, --indent=2] + args: [--autofix, --indent={{ Indentation }}] - id: trailing-whitespace - id: check-merge-conflict args: [--assume-in-merge] diff --git a/template/.yamllint.yml b/template/.yamllint.yml deleted file mode 100644 index 5e16e5fb..00000000 --- a/template/.yamllint.yml +++ /dev/null @@ -1,2 +0,0 @@ -rules: - indentation: { spaces: 2 } diff --git a/template/.yamllint.yml.jinja b/template/.yamllint.yml.jinja new file mode 100644 index 00000000..b9efb8e1 --- /dev/null +++ b/template/.yamllint.yml.jinja @@ -0,0 +1,2 @@ +rules: + indentation: { spaces: {{ Indentation }} } diff --git a/test/runtests.jl b/test/runtests.jl index d70cfdcc..4833de31 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,6 +9,7 @@ template_options = Dict( "AuthorEmail" => "test@me.now", "JuliaMinVersion" => "1.6", "License" => "MIT", + "Indentation" => "3", "AddMacToCI" => true, "AddWinToCI" => true, "RunJuliaNightlyOnCI" => true,