mirror of https://github.com/astral-sh/ruff
Cleanup internal commentary on the fix rules
This commit is contained in:
parent
6577833435
commit
d004ddc674
|
|
@ -237,14 +237,12 @@ pub fn check(args: CheckCommand, log_level: LogLevel) -> Result<ExitStatus> {
|
||||||
|
|
||||||
// Fix rules are as follows:
|
// Fix rules are as follows:
|
||||||
// - By default, generate all fixes, but don't apply them to the filesystem.
|
// - By default, generate all fixes, but don't apply them to the filesystem.
|
||||||
// - If `--fix` or `--fix-only` is set, always apply fixes to the filesystem (or
|
// - If `--fix` or `--fix-only` is set, apply applicable fixes to the filesystem (or
|
||||||
// print them to stdout, if we're reading from stdin) for [`Applicability::Automatic`] rules
|
// print them to stdout, if we're reading from stdin).
|
||||||
// only.
|
// - If `--diff` or `--fix-only` are set, don't print any violations (only applicable fixes)
|
||||||
// - If `--diff` or `--fix-only` are set, don't print any violations (only
|
// - By default, applicable fixes only include [`Applicablility::Automatic`], but if
|
||||||
// fixes) for [`Applicability::Automatic`] rules only.
|
// `--fix--suggested` is set, then [`Applicablility::Suggested`] fixes are included.
|
||||||
// - If `--fix--suggested` is set, the above rules will apply to both [`Applicability::Suggested`] and
|
|
||||||
// [`Applicability::Automatic`] fixes.
|
|
||||||
// TODO: can't fix this until @zanieb changes the CLI
|
|
||||||
let fix_suggested = if fix_suggested {
|
let fix_suggested = if fix_suggested {
|
||||||
SuggestedFixes::Apply
|
SuggestedFixes::Apply
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -256,7 +254,7 @@ pub fn check(args: CheckCommand, log_level: LogLevel) -> Result<ExitStatus> {
|
||||||
} else if fix || fix_only {
|
} else if fix || fix_only {
|
||||||
FixMode::Apply(fix_suggested)
|
FixMode::Apply(fix_suggested)
|
||||||
} else {
|
} else {
|
||||||
// We'll always generate all fixes, regardless of [`Applicability`], in `generate` mode
|
// Always generate all fixes, regardless of [`Applicability`], in `generate` mode
|
||||||
FixMode::Generate(SuggestedFixes::Apply)
|
FixMode::Generate(SuggestedFixes::Apply)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue