Skip to content

Commit

Permalink
Add python script to jshint src folder. It needs an installed jshint.
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacsv committed Sep 29, 2013
1 parent 222c0ef commit 602f324
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,6 @@ def Main ():
DeleteFile (tempFilePath)
return

return

Main ()
34 changes: 34 additions & 0 deletions tools/jshint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import os
import sys
import re
import inspect

sourcesFolderName = '../src'

def PrintInfo (message):
print ('Info: ' + message)

def PrintError (error):
print ('Error: ' + error)

def JSHintFolder (folderPath):
result = os.system ('jshint ' + folderPath)
if result != 0:
return False
return True

def Main ():
currentPath = os.path.dirname (os.path.abspath (inspect.getsourcefile (Main)))
os.chdir (currentPath)

sourcesPath = os.path.abspath (sourcesFolderName)

PrintInfo ('JSHint folder <' + sourcesPath + '>.');
succeeded = JSHintFolder (sourcesPath)
if not succeeded:
PrintError ('Found JSHint errors.');
return

return

Main ()

0 comments on commit 602f324

Please sign in to comment.