Skip to content

Automate spellcheck configuration based on tool presence#281

Merged
arran4 merged 1 commit intomainfrom
auto-spellcheck-detection-4572349562026552516
Apr 14, 2026
Merged

Automate spellcheck configuration based on tool presence#281
arran4 merged 1 commit intomainfrom
auto-spellcheck-detection-4572349562026552516

Conversation

@arran4
Copy link
Copy Markdown
Owner

@arran4 arran4 commented Apr 14, 2026

Replaced the interactive promptBool for spellcheck in .chezmoi.toml.tmpl with an automated check. The configuration now uses lookPath to detect the presence of hunspell, aspell, or ispell executables, automatically enabling the spellcheck flag if any are found. This streamlines the initialization process by reducing manual prompts.


PR created automatically by Jules for task 4572349562026552516 started by @arran4

Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request automates the detection of spellcheck tools in the .chezmoi.toml.tmpl configuration. Feedback suggests retaining the promptBool to allow users to manually opt out while using the automated detection as a default value, and provides a more concise way to write the detection logic.

Comment thread .chezmoi.toml.tmpl
{{- $autoGit := promptBool "auto git?" true -}}
{{- $spellcheckGuess := true -}}
{{- $spellcheck := promptBool "spellcheck" $spellcheckGuess -}}
{{- $spellcheck := or (lookPath "hunspell" | not | not) (lookPath "aspell" | not | not) (lookPath "ispell" | not | not) -}}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Automating the detection of spellcheck tools is a good improvement, but removing the promptBool prevents users from opting out if they have the tools installed but prefer not to enable the feature (e.g., for performance reasons). It is recommended to use the automated detection as the default value for the prompt. This maintains consistency with other configuration options in this file (like headless and gpgconfigured) and preserves user flexibility. The logic can also be simplified by applying not | not once to the result of the or expression.

{{- $spellcheckGuess := or (lookPath "hunspell") (lookPath "aspell") (lookPath "ispell") | not | not -}}
{{- $spellcheck := promptBool "spellcheck" $spellcheckGuess -}}

@arran4 arran4 merged commit 0151f8e into main Apr 14, 2026
9 checks passed
@arran4 arran4 deleted the auto-spellcheck-detection-4572349562026552516 branch April 14, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant