From 52e33f754f911122483b7d46c67210ea304b3046 Mon Sep 17 00:00:00 2001 From: Abel Soares Siqueira Date: Sat, 13 Jul 2024 13:03:21 +0200 Subject: [PATCH] Change the templates' JuliaFormatter config to be simpler Removes most of the configuration, leaving only basic information, like indentation, line ending, and margin. Closes #358 --- CHANGELOG.md | 4 +++ src/BestieTemplate.jl | 56 ++++++++++++++--------------- template/.JuliaFormatter.toml.jinja | 15 -------- 3 files changed, 32 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94763484..b7221eea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning]. ## [Unreleased] +### Changed + +- Default `.JuliaFormatter` now includes only minimal configuration that matches `.editorconfig` (#358) + ## [0.8.0] - 2024-07-08 ### Added diff --git a/src/BestieTemplate.jl b/src/BestieTemplate.jl index cb3f1c7e..381ef255 100644 --- a/src/BestieTemplate.jl +++ b/src/BestieTemplate.jl @@ -31,24 +31,24 @@ function _copy(src_path, dst_path, data; kwargs...) display(md"""Hi, **❤ Bestie ❤** here. - Below you will find a few questions to configure your template. - First, some **required** questions will need to be filled. - Then, you will have the option of selecting + Below you will find a few questions to configure your template. + First, some **required** questions will need to be filled. + Then, you will have the option of selecting - - The _recommended_ options, which includes our current _best practices recommendations_; - - The _minimum_ options, which will answer _no_ to everything, but still give you what - we consider the minimum best practices you need to get started; or - - Answer every optional question. + - The _recommended_ options, which includes our current _best practices recommendations_; + - The _minimum_ options, which will answer _no_ to everything, but still give you what + we consider the minimum best practices you need to get started; or + - Answer every optional question. - On any case, we suggest reading the **full guide**, and possibly other documentation pages: + On any case, we suggest reading the **full guide**, and possibly other documentation pages: - `https://abelsiqueira.com/BestieTemplate.jl/stable/10-full-guide` + `https://abelsiqueira.com/BestieTemplate.jl/stable/10-full-guide` - If something does not work as you would expect or you need clarifications, - please open an issue or discussion. + If something does not work as you would expect or you need clarifications, + please open an issue or discussion. - **❤ Good luck filling the questions, and thanks for choosing BestieTemplate ❤** - """) + **❤ Good luck filling the questions, and thanks for choosing BestieTemplate ❤** + """) Copier.copy(src_path, dst_path, data; kwargs...) end @@ -161,23 +161,23 @@ function apply(src_path, dst_path, data::Dict = Dict(); warn_existing_pkg = true println("""BestieTemplate was applied to $package_name.jl! 🎉 - Next steps: + Next steps: - Review the modifications. - In particular README.md and docs/src/index.md tend to be heavily edited. + Review the modifications. + In particular README.md and docs/src/index.md tend to be heavily edited. - \$ git switch -c apply-bestie # If you haven't created a branch - \$ git add . - \$ pre-commit run -a # Try to fix possible pre-commit issues (failures are expected) - \$ pre-commit run -a # Again. Now failures should not happen - \$ gid add . - \$ git commit -m "Apply BestieTemplate $bestie_version" - \$ pre-commit install - \$ git push -u origin apply-bestie - - Go to GitHub and create a Pull Request from apply-bestie to main. - Continue on the full guide: https://abelsiqueira.com/BestieTemplate.jl/stable/10-full-guide - """) + \$ git switch -c apply-bestie # If you haven't created a branch + \$ git add . + \$ pre-commit run -a # Try to fix possible pre-commit issues (failures are expected) + \$ pre-commit run -a # Again. Now failures should not happen + \$ gid add . + \$ git commit -m "Apply BestieTemplate $bestie_version" + \$ pre-commit install + \$ git push -u origin apply-bestie + + Go to GitHub and create a Pull Request from apply-bestie to main. + Continue on the full guide: https://abelsiqueira.com/BestieTemplate.jl/stable/10-full-guide + """) return nothing end diff --git a/template/.JuliaFormatter.toml.jinja b/template/.JuliaFormatter.toml.jinja index 70c7d0fc..6265796c 100644 --- a/template/.JuliaFormatter.toml.jinja +++ b/template/.JuliaFormatter.toml.jinja @@ -1,18 +1,3 @@ -align_assignment = true -align_matrix = true -align_pair_arrow = true -align_struct_field = true -always_for_in = true -annotate_untyped_fields_with_any = false -conditional_to_if = true -for_in_replacement = "in" -format_docstrings = false -format_markdown = false -import_to_using = true indent = {{ Indentation }} margin = 100 normalize_line_endings = "unix" -remove_extra_newlines = true -separate_kwargs_with_semicolon = true -whitespace_ops_in_indices = true -whitespace_typedefs = true