sqlint 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -3
  3. data/bin/sqlint +14 -1
  4. data/lib/sqlint/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1818ac454c1a121f69ed183256ae3c37be861688
4
- data.tar.gz: 1abcea8211582b08930e0d6bb9b28c3c7b2a3a64
3
+ metadata.gz: efe566a4b8ebe9684a0f16fad5069040ea7c71b3
4
+ data.tar.gz: f56d2b20dfa6d9f4615551a4711fa196c4ab11f3
5
5
  SHA512:
6
- metadata.gz: deabb1c4f76d95d26db128cfddfda71ea22934ece4f1542a1d6746e7b5ba546b05a243297f8f4051450ba1afda5709c2284dcc37e8959a6c247b97a42cfc2c60
7
- data.tar.gz: fb996c9fae430b5cad54b3b47042917bc96b77b68c4d17f50c7f517d51073046b28a392bd0784a01f5eaad87d4bcabf46f4f1572e7e48a54685cd00651357f3a
6
+ metadata.gz: e88ab080386db0601b5bf0b8a146dc0cb7d62faeb927413e92f1b8fa3119f49fa39ab0b27997c66df644734a49e28826c61560001e4c1573c74370882361c715
7
+ data.tar.gz: 6bc32615630fc20a39047560cb7752f7d28480dbd392cf388f8d59fee0fe19c298cc6954766fdb274806aad7f3fb1ef2e896d33c691a98ed44cabce5aa8034cc
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/purcell/sqlint.png?branch=master)](https://travis-ci.org/purcell/sqlint)
2
+
1
3
  ## SQLint - a simple SQL linter
2
4
 
3
5
  ### About
@@ -29,9 +31,9 @@ sqlint filename.sql
29
31
 
30
32
  Support for `sqlint` is provided for the following editors:
31
33
 
32
- - Emacs, via Flycheck (submission pending)
33
- - VIM, via Syntastic (submission pending)
34
- - SublimeText, via the SublimeLinter package (submission pending)
34
+ - Emacs, via Flycheck ([submission pending](https://github.com/flycheck/flycheck/pull/691))
35
+ - VIM, via Syntastic ([submission pending](https://github.com/scrooloose/syntastic/pull/1477))
36
+ - SublimeText, via the SublimeLinter package ([submission pending](https://github.com/SublimeLinter/SublimeLinter3/issues/297))
35
37
 
36
38
  ### Authors
37
39
 
data/bin/sqlint CHANGED
@@ -14,13 +14,26 @@ if ARGV.include?("--version")
14
14
  exit 0
15
15
  end
16
16
 
17
+ if ARGV.empty? || ARGV.include?("--help") || ARGV.include?("-h")
18
+ puts "Usage: sqlint file.sql ..."
19
+ exit 0
20
+ end
21
+
17
22
  ERROR_TYPES = {error: "ERROR", warning: "WARNING"}
18
23
 
24
+ class String
25
+ def sanitise
26
+ gsub(/[[:cntrl:]+]/) do |bad|
27
+ bad.codepoints.map { |c| "\\%04d" % c }.join
28
+ end
29
+ end
30
+ end
31
+
19
32
  ARGV.each do |filename|
20
33
  File.open(filename, 'r') do |file|
21
34
  results = SQLint::Linter.new(filename, file).run
22
35
  results.each do |lint|
23
- message_lines = lint.message.split("\n")
36
+ message_lines = lint.message.sanitise.split("\n")
24
37
  puts [
25
38
  lint.filename,
26
39
  lint.line,
@@ -1,3 +1,3 @@
1
1
  module SQLint
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Purcell