Add a fixer command.

This commit is contained in:
Amy Boyd
2016-12-22 14:02:44 +00:00
parent 948f51d2a7
commit 67e51c079a
10 changed files with 126 additions and 24 deletions

View File

@@ -3,7 +3,6 @@ package editorconfig
import (
"fmt"
"github.com/codegangsta/cli"
"io/ioutil"
"strconv"
"strings"
)
@@ -26,11 +25,7 @@ func CheckCommand(c *cli.Context) error {
continue
}
fileContentInBytes, err := ioutil.ReadFile(f)
if err != nil {
ExitBecauseOfInternalError("Could not read file: " + f)
}
fileContent := string(fileContentInBytes)
fileContent := MustGetFileAsString(f)
// Run full-file checkers.
for ruleName, ruleValue := range rules {