2023-05-23 10:10:09 +02:00
|
|
|
package ifelse
|
|
|
|
|
|
|
|
// PreserveScope is a configuration argument that prevents suggestions
|
|
|
|
// that would enlarge variable scope
|
|
|
|
const PreserveScope = "preserveScope"
|
|
|
|
|
2024-11-28 09:51:33 +02:00
|
|
|
// AllowJump is a configuration argument that permits early-return to
|
|
|
|
// suggest introducing a new jump (return, continue, etc) statement
|
|
|
|
// to reduce nesting. By default, suggestions only bring existing jumps
|
|
|
|
// earlier.
|
|
|
|
const AllowJump = "allowJump"
|
|
|
|
|
2023-05-23 10:10:09 +02:00
|
|
|
// Args contains arguments common to the early-return, indent-error-flow
|
2024-11-28 09:51:33 +02:00
|
|
|
// and superfluous-else rules
|
2023-05-23 10:10:09 +02:00
|
|
|
type Args struct {
|
|
|
|
PreserveScope bool
|
2024-11-28 09:51:33 +02:00
|
|
|
AllowJump bool
|
2023-05-23 10:10:09 +02:00
|
|
|
}
|