From 2d226064c83744f24b63b00de3c763796572ad64 Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Tue, 29 Oct 2024 21:59:12 +0100 Subject: [PATCH] Officially support fix-all-without-prompt --- CHANGELOG.md | 1 + lib/flags.js | 17 ++++++++++++----- test/snapshots/help/default.txt | 5 +++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aa2baad4..d89992b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [Unreleased] +- Publicly document the `--fix-all-without-prompt` CLI flag. Please use it well! - Fixed an issue where the initial rule created with `elm-review new-package` was always a module rule, even when it was requested to be a project rule. Thanks to [@mateusfpleite](https://github.com/mateusfpleite)! - Plenty of behind the scenes improvement to the maintenance of the repository. Thanks to [@lishaduck](https://github.com/lishaduck) for all of those. diff --git a/lib/flags.js b/lib/flags.js index 3b6cea86d..af6b437bf 100644 --- a/lib/flags.js +++ b/lib/flags.js @@ -334,6 +334,18 @@ const flags = [ `Fixed files will be reformatted using ${chalk.magentaBright('elm-format')}.` ] }, + { + name: 'fix-all-without-prompt', + boolean: true, + color: chalk.blueBright, + sections: ['fix'], + description: [ + // prettier-ignore + `Same as ${chalk.blueBright('--fix-all')} but fixes are applied without a prompt.`, + 'I recommend to commit all changes prior to running with this option and', + 'to review the applied changes afterwards.' + ] + }, { name: 'fix-limit', boolean: false, @@ -344,11 +356,6 @@ const flags = [ sections: ['fix'], description: ['Limit the number of fixes applied in a single batch to N.'] }, - { - name: 'fix-all-without-prompt', - boolean: true, - sections: null - }, { name: 'elm-format-path', boolean: false, diff --git a/test/snapshots/help/default.txt b/test/snapshots/help/default.txt index 02327a45c..4a4556883 100644 --- a/test/snapshots/help/default.txt +++ b/test/snapshots/help/default.txt @@ -120,6 +120,11 @@ If you wish to use automatic fixing, you can use the following flags: called without --fix-all. Fixed files will be reformatted using elm-format. + --fix-all-without-prompt + Same as --fix-all but fixes are applied without a prompt. + I recommend to commit all changes prior to running with this option and + to review the applied changes afterwards. + --fix-limit=N Limit the number of fixes applied in a single batch to N.