Permalink
Browse files

Add script to find long line in .js files.

  • Loading branch information...
1 parent 4ee55ad commit fecc81655f46fb843353c8249793847b3a8b03b9 @0xfe committed Nov 24, 2012
Showing with 24 additions and 0 deletions.
  1. +24 −0 tools/find_inconsistent_style.rb
@@ -0,0 +1,24 @@
+#!/usr/bin/ruby
+
+# VexFlow - Copyright Mohit Muthanna Cheppudira 2012
+#
+# Look for >80 lines and hard tabs.
+
+SRCDIR = "../src"
+DIRS = [ "../src/*.js", "../vextab/*.js" ]
+
+unless File.exists?(SRCDIR)
+ puts "This script needs to be run from the tools/ directory."
+ exit 1
+end
+
+DIRS.each do |dir|
+ files = Dir.glob(dir)
+ files.each do |file|
+ line = 0
+ File.read(file).each_line do |l|
+ line += 1
+ puts "#{file}:#{line} -- #{l.length}" if l.length > 80
+ end
+ end
+end

0 comments on commit fecc816

Please sign in to comment.