Add function GetRulesToApplyToSourcePath.

This commit is contained in:
Amy Boyd
2016-06-22 23:58:10 +01:00
parent cfc8de6801
commit 2a8ad5689c
4 changed files with 114 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package editorconfig
import (
"github.com/go-ini/ini"
"path/filepath"
"regexp"
"strings"
)
@@ -51,9 +52,11 @@ type FileConstrainedRuleSet struct {
}
func CreateConfigFileStruct(path string) ConfigFile {
absPath, _ := filepath.Abs(path)
ini, err := ini.Load(path)
if err != nil {
ExitBecauseOfInternalError("Could not parse " + path)
ExitBecauseOfInternalError("Could not parse " + absPath)
}
cf := ConfigFile{}