Automate spellcheck configuration based on tool presence#281
Conversation
Co-authored-by: arran4 <111667+arran4@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
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.
| {{- $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) -}} |
There was a problem hiding this comment.
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 -}}
Replaced the interactive
promptBoolforspellcheckin.chezmoi.toml.tmplwith an automated check. The configuration now useslookPathto detect the presence ofhunspell,aspell, orispellexecutables, automatically enabling thespellcheckflag if any are found. This streamlines the initialization process by reducing manual prompts.PR created automatically by Jules for task 4572349562026552516 started by @arran4