Skip to content

Commit

Permalink
fix: exclude LT from loading altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Nov 21, 2020
1 parent 1f30a3a commit 0cedc2f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions check/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,19 @@ func (mgr *Manager) loadStyles(styles []string) error {

baseDir := mgr.Config.StylesPath
for _, style := range styles {
if style == "LanguageTool" {
// Special case
continue
}
p := filepath.Join(baseDir, style)
if mgr.hasStyle(style) {
// We've already loaded this style.
continue
} else if has, _ := mgr.Config.FsWrapper.DirExists(p); !has {
if style != "LanguageTool" {
return core.NewE100(
"loadStyles",
errors.New("style '"+style+"' does not exist on StylesPath"))
}

return core.NewE100(
"loadStyles",
errors.New("style '"+style+"' does not exist on StylesPath"))
}
if err := mgr.addStyle(p); err != nil {
return err
Expand Down

0 comments on commit 0cedc2f

Please sign in to comment.