Simplified boolean comparisons
Just a bit easier to read, in my opinion.
This commit is contained in:
parent
09296c0214
commit
04d4881512
@ -42,10 +42,7 @@ func (ci *Evaluator) LoadConfig(configFile string) error {
|
|||||||
|
|
||||||
func (ci *Evaluator) isRuleEnabled(rule Rule) bool {
|
func (ci *Evaluator) isRuleEnabled(rule Rule) bool {
|
||||||
value := ci.Config.GetString(rule.Key())
|
value := ci.Config.GetString(rule.Key())
|
||||||
if value == "disabled" {
|
return value != "disabled"
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ci *Evaluator) Evaluate(analysis *image.AnalysisResult) bool {
|
func (ci *Evaluator) Evaluate(analysis *image.AnalysisResult) bool {
|
||||||
|
@ -62,10 +62,7 @@ func (controller *DetailsController) Setup(v *gocui.View, header *gocui.View) er
|
|||||||
|
|
||||||
// IsVisible indicates if the details view pane is currently initialized.
|
// IsVisible indicates if the details view pane is currently initialized.
|
||||||
func (controller *DetailsController) IsVisible() bool {
|
func (controller *DetailsController) IsVisible() bool {
|
||||||
if controller == nil {
|
return controller != nil
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CursorDown moves the cursor down in the details pane (currently indicates nothing).
|
// CursorDown moves the cursor down in the details pane (currently indicates nothing).
|
||||||
|
@ -182,10 +182,7 @@ func (controller *FileTreeController) Setup(v *gocui.View, header *gocui.View) e
|
|||||||
|
|
||||||
// IsVisible indicates if the file tree view pane is currently initialized
|
// IsVisible indicates if the file tree view pane is currently initialized
|
||||||
func (controller *FileTreeController) IsVisible() bool {
|
func (controller *FileTreeController) IsVisible() bool {
|
||||||
if controller == nil {
|
return controller != nil
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// resetCursor moves the cursor back to the top of the buffer and translates to the top of the buffer.
|
// resetCursor moves the cursor back to the top of the buffer and translates to the top of the buffer.
|
||||||
|
@ -86,10 +86,7 @@ func (vm *FileTreeViewModel) bufferIndexUpperBound() int {
|
|||||||
|
|
||||||
// IsVisible indicates if the file tree view pane is currently initialized
|
// IsVisible indicates if the file tree view pane is currently initialized
|
||||||
func (vm *FileTreeViewModel) IsVisible() bool {
|
func (vm *FileTreeViewModel) IsVisible() bool {
|
||||||
if vm == nil {
|
return vm != nil
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// resetCursor moves the cursor back to the top of the buffer and translates to the top of the buffer.
|
// resetCursor moves the cursor back to the top of the buffer and translates to the top of the buffer.
|
||||||
|
@ -135,10 +135,7 @@ func (controller *LayerController) height() uint {
|
|||||||
|
|
||||||
// IsVisible indicates if the layer view pane is currently initialized.
|
// IsVisible indicates if the layer view pane is currently initialized.
|
||||||
func (controller *LayerController) IsVisible() bool {
|
func (controller *LayerController) IsVisible() bool {
|
||||||
if controller == nil {
|
return controller != nil
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PageDown moves to next page putting the cursor on top
|
// PageDown moves to next page putting the cursor on top
|
||||||
|
@ -40,10 +40,7 @@ func (controller *StatusController) Setup(v *gocui.View, header *gocui.View) err
|
|||||||
|
|
||||||
// IsVisible indicates if the status view pane is currently initialized.
|
// IsVisible indicates if the status view pane is currently initialized.
|
||||||
func (controller *StatusController) IsVisible() bool {
|
func (controller *StatusController) IsVisible() bool {
|
||||||
if controller == nil {
|
return controller != nil
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// CursorDown moves the cursor down in the details pane (currently indicates nothing).
|
// CursorDown moves the cursor down in the details pane (currently indicates nothing).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user