Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
htmllint and coffeelint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Aug 29, 2015
1 parent dd9ec4d commit 07d798a
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 46 deletions.
15 changes: 15 additions & 0 deletions .htmlhintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-value-double-quotes": true,
"doctype-first": false,
"head-script-disabled": true,
"id-class-value": "underline",
"id-unique": true,
"space-tab-mixed-disabled": true,
"spec-char-escape": true,
"style-disabled": true,
"tag-pair": true,
"tag-self-close": true,
"tagname-lowercase": true
}
12 changes: 0 additions & 12 deletions .htmllintrc

This file was deleted.

14 changes: 7 additions & 7 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/>
<meta http-equiv="x-ua-compatible" content="ie=edge"/>
<meta name="description" content=""/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>

<link rel="stylesheet" href="vendor/css/semantic.min.css">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="vendor/css/semantic.min.css"/>
<link rel="stylesheet" href="css/index.css"/>
</head>
<body>
<header>
Expand Down
10 changes: 5 additions & 5 deletions app/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>

<div class="ui fluid action input lol_dir_input">
<input id="install_path" type="text">
<input id="install_path" type="text"/>
<button id="browse" class="ui grey button" type="button">Browse</button>
</div>
<br />
Expand All @@ -27,7 +27,7 @@

<div class="ui checkbox left">
<input type="checkbox" id="options_skillsformat" />
<label class="options_tooltip" data-content="Instead of Q.W.E.Q.W.R.Q.W.Q.W ect">Use Shorthand for Skill Order (Q>W>E)</label>
<label class="options_tooltip" data-content="Instead of Q.W.E.Q.W.R.Q.W.Q.W ect">Use Shorthand for Skill Order (Q&#60;W&#60;E)</label>
</div>

<div class="with_dropdown">
Expand Down Expand Up @@ -74,7 +74,7 @@

<div class="rift_source">
<div id="sr_source" class="ui selection dropdown">
<input type="hidden" id="options_sr_source" value="championgg">
<input type="hidden" id="options_sr_source" value="championgg"/>
<i class="dropdown icon"></i>
<div id="sr_source_text" class="text">Champion.gg</div>
<div class="menu">
Expand All @@ -99,7 +99,7 @@
<br />

<div class="versions">
<div>Item Sets Version: <span id="local_version">Unknown</span></div>
<div>Item Sets Version: <span id="local_version">Unknown</span></div>
<div>LoL Version: <span id="lol_version">Loading...</span></div>
<div>Champion.gg Version: <span id="championgg_version">Loading...</span></div>
<div>Lolflavor Version: <span id="lolflavor_version">Loading...</span></div>
Expand All @@ -117,7 +117,7 @@ <h2>Status</h2>
</div>
</div>
<div class="progresslog">
<div id="cl-progress">
<div id="cl_progress">
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ gulp.task 'setup', ->
# Main Tasks
gulp.task 'main', (cb) ->
runSequence(
'delete-dev',
'mkdir:app',
'delete-dev'
'mkdir:app'
['electron:packagejson'
'electron:settings'
'bower_copy'
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
###
cl: (text, level='info') ->
window.log[level](text)
$('#cl-progress').prepend('<span>'+text+'</span><br />')
$('#cl_progress').prepend('<span>'+text+'</span><br />')


###*
Expand Down
2 changes: 1 addition & 1 deletion lib/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ deleteItemSets = ->
else
# TODO: Verify if is Windows admin and can delete.
championify.delete ->
$('#cl-progress > span').append('. Done!')
$('#cl_progress > span').append('. Done!')
, true


Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@
"gulp-coffeelint": "0.5.0",
"gulp-delete-lines": "0.0.7",
"gulp-flatten": "0.0.4",
"gulp-htmllint": "0.0.5",
"gulp-htmlhint": "0.3.0",
"gulp-if": "1.2.5",
"gulp-inno": "0.0.2",
"gulp-jsonlint": "1.1.0",
"gulp-shell": "^0.4.2",
"gulp-shell": "0.4.2",
"gulp-stylint": "2.0.0",
"gulp-stylus": "2.0.3",
"gulp-uglify": "1.2.0",
"gulp-util": "3.0.5",
"gulp-wait": "0.0.2",
"gulp-watch": "4.2.4",
"htmlhint-stylish": "1.0.3",
"moment": "2.10.6",
"nib": "1.1.0",
"plist": "1.1.0",
"preen": "1.2.0",
"rcedit": "0.3.0",
"request": "2.57.0",
"require-dir": "0.3.0",
"run-sequence": "1.1.0",
"run-sequence": "1.1.2",
"stylint": "1.2.2",
"stylint-stylish": "1.2.0",
"yauzl": "2.3.1"
Expand Down
33 changes: 19 additions & 14 deletions tasks/tests.coffee
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
coffeelint = require 'gulp-coffeelint'
gulp = require 'gulp'
htmllint = require 'gulp-htmllint'
htmlhint = require 'gulp-htmlhint'
jsonlint = require 'gulp-jsonlint'
path = require 'path'
runSequence = require 'run-sequence'
shell = require 'gulp-shell'
stylish = require 'coffeelint-stylish'
stylint = require 'gulp-stylint'
wait = require 'gulp-wait'


gulp.task 'coffeelint', ->
coffeelint_config = path.resolve(path.join(__dirname, '..', 'coffeelint.json'))
return gulp.src([
'./electron.coffee'
'./gulpfile.coffee'
'./lib/**/*.coffee'
'./tasks/**/*.coffee'
'./tests/**/*.coffee'
])
.pipe(coffeelint(coffeelint_config))
.pipe(coffeelint.reporter(stylish))
.pipe(wait(1500)) # Work around so all stylish linter results come up on top. TODO: Replace.
.pipe(coffeelint.reporter('failOnWarning'))

gulp.task 'stylint', ->
Expand All @@ -32,32 +31,38 @@ gulp.task 'stylint', ->
reporter: 'stylint-stylish'
}))

gulp.task 'htmllint', ->
htmllink_config = path.resolve(path.join(__dirname, '..', '.htmllintrc'))
gulp.task 'htmlhint', ->
return gulp.src('app/**/*.html')
.pipe(htmllint({
config: htmllink_config
}))
.pipe(htmlhint('.htmlhintrc'))
.pipe(htmlhint.reporter('htmlhint-stylish'))
.pipe(htmlhint.failReporter({suppress: true}))

gulp.task 'jsonlint', ->
return gulp.src('./data/**/*.json')
return gulp.src([
'./data/**/*.json'
'./.htmlhintrc'
'./.stylintrc'
'./coffeelint.json'
'./package.json'
'./bower.json'
])
.pipe(jsonlint())
.pipe(jsonlint.failOnError())


gulp.task 'lint', (cb) ->
return runSequence('coffeelint', 'stylint', 'jsonlint', cb)
runSequence('coffeelint', 'stylint', 'jsonlint', cb)


gulp.task 'mocha', ->
if process.platform == 'win32'
cmd = 'setlocal ENABLEDELAYEDEXPANSION && set "ELECTRON_PATH=./node_modules/.bin/electron" && ./node_modules/.bin/electron-mocha --renderer ./tests/'
electron_path = path.resolve('./node_modules/.bin/electron-mocha')
cmd = "setlocal ENABLEDELAYEDEXPANSION && set \"ELECTRON_PATH=./node_modules/.bin/electron\" && \"#{electron_path}\" --renderer ./tests/"
else
cmd = 'ELECTRON_PATH=./node_modules/.bin/electron ./node_modules/.bin/electron-mocha --renderer ./tests/'

return gulp.src('')
.pipe shell(cmd)
return gulp.src('').pipe shell(cmd)


gulp.task 'test', (cb) ->
return runSequence('lint', 'mocha', cb)
runSequence('lint', 'mocha', cb)

0 comments on commit 07d798a

Please sign in to comment.