From 0df387dac3b7c31a5240a809605d13a478587935 Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Thu, 11 Jun 2015 23:10:00 -0300 Subject: [PATCH] Beautify all spec/ files to pass linting with Coffeelint --- build-package.sh | 4 ++-- package.json | 2 +- spec/beautify-languages-spec.coffee | 32 ++++++++++++++--------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build-package.sh b/build-package.sh index 183b003..d61c498 100644 --- a/build-package.sh +++ b/build-package.sh @@ -26,9 +26,9 @@ if [ "$TEST_PACKAGES" != "none" ]; then fi if [ -f ./node_modules/.bin/coffeelint ]; then - if [ -d ./lib ]; then + if [ -d ./src ]; then echo "Linting package..." - ./node_modules/.bin/coffeelint lib + ./node_modules/.bin/coffeelint src rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi fi if [ -d ./spec ]; then diff --git a/package.json b/package.json index 9902806..2cbe784 100644 --- a/package.json +++ b/package.json @@ -150,6 +150,6 @@ "scripts": { "prepublish": "npm run docs", "docs": "coffee docs/", - "lint": "coffeelint src/" + "lint": "coffeelint src/ spec/" } } diff --git a/spec/beautify-languages-spec.coffee b/spec/beautify-languages-spec.coffee index ec5b721..6d10c4d 100644 --- a/spec/beautify-languages-spec.coffee +++ b/spec/beautify-languages-spec.coffee @@ -181,22 +181,22 @@ describe "BeautifyLanguages", -> return beautifyCompleted = true if typeof text isnt "string" # Check for beautification errors if text isnt expectedContents - # console.warn(allOptions, text, expectedContents) - fileName = expectedTestPath - oldStr=text - newStr=expectedContents - oldHeader="beautified" - newHeader="expected" - diff = JsDiff.createPatch(fileName, oldStr, \ - newStr, oldHeader, newHeader) - # Get options - opts = beautifier.getOptionsForLanguage(allOptions, language) - # Show error message with debug information - expect(text).toEqual(expectedContents, \ - "Beautifier output does not match expected \ - output:\n#{diff}\n\n\ - With options:\n\ - #{JSON.stringify(opts, undefined, 4)}") + # console.warn(allOptions, text, expectedContents) + fileName = expectedTestPath + oldStr=text + newStr=expectedContents + oldHeader="beautified" + newHeader="expected" + diff = JsDiff.createPatch(fileName, oldStr, \ + newStr, oldHeader, newHeader) + # Get options + opts = beautifier.getOptionsForLanguage(allOptions, language) + # Show error message with debug information + expect(text).toEqual(expectedContents, \ + "Beautifier output does not match expected \ + output:\n#{diff}\n\n\ + With options:\n\ + #{JSON.stringify(opts, undefined, 4)}") # All done! beautifyCompleted = true