sqlint 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +18 -0
- data/Gemfile.lock +22 -17
- data/README.md +18 -4
- data/flake.lock +42 -0
- data/flake.nix +31 -0
- data/gemset.nix +97 -0
- data/lib/sqlint/version.rb +1 -1
- data/sqlint.gemspec +4 -4
- metadata +19 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24f145b5245dc1d77ef0f1c1caa7dc39465316d30cfa7da4b7a0806ec28ad6f5
|
4
|
+
data.tar.gz: e8d6a6c3a2f854cbb647d504940f02209c9c36dbdb895a13423c02f2ea67e9c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dceaba878f571500c19db62421cf4a2a446b329ae606aecbe33eb729517cceb30e99e065e20f7b529794643cd8e3afb17e14f04e2ae14d03af7870ee8e154783
|
7
|
+
data.tar.gz: cb6fc48edec2c94c0ce563fee919d8e04c9821e52c1a113717bfdabb344dfd6f138405730c226eecc6c76ed930e0b79f704f1681530f090fa35aef3f14df90da
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: CI
|
2
|
+
on: [push, pull_request]
|
3
|
+
jobs:
|
4
|
+
test:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
os: [ubuntu-latest]
|
9
|
+
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
|
10
|
+
ruby: ['2.7', '3.0', '3.1', '3.2']
|
11
|
+
runs-on: ${{ matrix.os }}
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- uses: ruby/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
17
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
18
|
+
- run: bundle exec rake
|
data/Gemfile.lock
CHANGED
@@ -1,30 +1,35 @@
|
|
1
1
|
GEM
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
|
-
diff-lcs (1.
|
5
|
-
google-protobuf (3.
|
6
|
-
pg_query (2.
|
7
|
-
google-protobuf (
|
8
|
-
|
9
|
-
|
10
|
-
rspec-
|
11
|
-
rspec-
|
12
|
-
|
13
|
-
|
14
|
-
|
4
|
+
diff-lcs (1.5.0)
|
5
|
+
google-protobuf (3.25.0)
|
6
|
+
pg_query (4.2.3)
|
7
|
+
google-protobuf (>= 3.22.3)
|
8
|
+
rake (13.1.0)
|
9
|
+
rspec (3.12.0)
|
10
|
+
rspec-core (~> 3.12.0)
|
11
|
+
rspec-expectations (~> 3.12.0)
|
12
|
+
rspec-mocks (~> 3.12.0)
|
13
|
+
rspec-core (3.12.2)
|
14
|
+
rspec-support (~> 3.12.0)
|
15
|
+
rspec-expectations (3.12.3)
|
15
16
|
diff-lcs (>= 1.2.0, < 2.0)
|
16
|
-
rspec-support (~> 3.
|
17
|
-
rspec-mocks (3.
|
17
|
+
rspec-support (~> 3.12.0)
|
18
|
+
rspec-mocks (3.12.6)
|
18
19
|
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
-
rspec-support (~> 3.
|
20
|
-
rspec-support (3.
|
20
|
+
rspec-support (~> 3.12.0)
|
21
|
+
rspec-support (3.12.1)
|
21
22
|
|
22
23
|
PLATFORMS
|
23
24
|
ruby
|
24
25
|
|
25
26
|
DEPENDENCIES
|
26
|
-
pg_query (
|
27
|
+
pg_query (>= 1.0)
|
28
|
+
rake
|
27
29
|
rspec
|
28
30
|
|
31
|
+
RUBY VERSION
|
32
|
+
ruby 2.7.6p219
|
33
|
+
|
29
34
|
BUNDLED WITH
|
30
|
-
2.
|
35
|
+
2.4.2
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://
|
1
|
+
[![Build Status](https://github.com/purcell/sqlint/actions/workflows/ci.yml/badge.svg)](https://github.com/purcell/sqlint/actions/workflows/ci.yml)
|
2
2
|
[ ![](https://img.shields.io/gem/v/sqlint.svg)](https://rubygems.org/gems/sqlint)
|
3
3
|
[ ![](https://img.shields.io/gem/dt/sqlint.svg)](https://rubygems.org/gems/sqlint)
|
4
4
|
<a href="https://www.patreon.com/sanityinc"><img alt="Support me" src="https://img.shields.io/badge/Support%20Me-%F0%9F%92%97-ff69b4.svg"></a>
|
@@ -11,8 +11,8 @@ SQLint is a simple command-line linter which reads your SQL files and
|
|
11
11
|
reports any syntax errors or warnings it finds.
|
12
12
|
|
13
13
|
At this stage, SQLint checks SQL against the ANSI syntax, and uses the
|
14
|
-
PostgreSQL SQL parser to achieve this.
|
15
|
-
for non-standard SQL variants (e.g. MySQL)
|
14
|
+
PostgreSQL SQL parser to achieve this. SQLint does not have support
|
15
|
+
for non-standard SQL variants (e.g. MySQL), but contributions are welcome.
|
16
16
|
|
17
17
|
### Installation
|
18
18
|
|
@@ -30,6 +30,8 @@ To check the syntax of a file containing SQL, simply pass the filename to `sqlin
|
|
30
30
|
sqlint filename.sql
|
31
31
|
```
|
32
32
|
|
33
|
+
In the absence of a filename, `sqlint` reads from standard input.
|
34
|
+
|
33
35
|
### Editor plugins
|
34
36
|
|
35
37
|
Support for `sqlint` is provided for the following editors:
|
@@ -58,4 +60,16 @@ This software was written by
|
|
58
60
|
|
59
61
|
### License and copyright
|
60
62
|
|
61
|
-
Copyright Powershop NZ Ltd.
|
63
|
+
Copyright 2015-2018 Powershop NZ Ltd.
|
64
|
+
Copyright 2018-2021 Steve Purcell.
|
65
|
+
MIT license.
|
66
|
+
|
67
|
+
<hr>
|
68
|
+
|
69
|
+
[💝 Support this project and my other Open Source work via Patreon](https://www.patreon.com/sanityinc)
|
70
|
+
|
71
|
+
[💼 LinkedIn profile](https://uk.linkedin.com/in/stevepurcell)
|
72
|
+
|
73
|
+
[✍ sanityinc.com](http://www.sanityinc.com/)
|
74
|
+
|
75
|
+
[🐦 @sanityinc](https://twitter.com/sanityinc)
|
data/flake.lock
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"nodes": {
|
3
|
+
"flake-utils": {
|
4
|
+
"locked": {
|
5
|
+
"lastModified": 1667395993,
|
6
|
+
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
7
|
+
"owner": "numtide",
|
8
|
+
"repo": "flake-utils",
|
9
|
+
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
10
|
+
"type": "github"
|
11
|
+
},
|
12
|
+
"original": {
|
13
|
+
"owner": "numtide",
|
14
|
+
"repo": "flake-utils",
|
15
|
+
"type": "github"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"nixpkgs": {
|
19
|
+
"locked": {
|
20
|
+
"lastModified": 1672756850,
|
21
|
+
"narHash": "sha256-Smbq3+fitwA13qsTMeaaurv09/KVbZfW7m7lINwzDGA=",
|
22
|
+
"owner": "NixOS",
|
23
|
+
"repo": "nixpkgs",
|
24
|
+
"rev": "298add347c2bbce14020fcb54051f517c391196b",
|
25
|
+
"type": "github"
|
26
|
+
},
|
27
|
+
"original": {
|
28
|
+
"id": "nixpkgs",
|
29
|
+
"ref": "nixpkgs-unstable",
|
30
|
+
"type": "indirect"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"root": {
|
34
|
+
"inputs": {
|
35
|
+
"flake-utils": "flake-utils",
|
36
|
+
"nixpkgs": "nixpkgs"
|
37
|
+
}
|
38
|
+
}
|
39
|
+
},
|
40
|
+
"root": "root",
|
41
|
+
"version": 7
|
42
|
+
}
|
data/flake.nix
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
{
|
2
|
+
description = "sqlint tool";
|
3
|
+
|
4
|
+
inputs = {
|
5
|
+
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
|
6
|
+
flake-utils.url = "github:numtide/flake-utils";
|
7
|
+
};
|
8
|
+
|
9
|
+
outputs = { self, nixpkgs, flake-utils }@inputs:
|
10
|
+
flake-utils.lib.eachDefaultSystem (system:
|
11
|
+
let
|
12
|
+
pkgs = import nixpkgs { inherit system; };
|
13
|
+
env = pkgs.bundlerEnv {
|
14
|
+
name = "sqlint";
|
15
|
+
gemdir = ./.;
|
16
|
+
groups = ["default" "development" "test"];
|
17
|
+
|
18
|
+
meta = with pkgs.lib;
|
19
|
+
{
|
20
|
+
description = "sqlint";
|
21
|
+
platforms = platforms.unix;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
in
|
25
|
+
{
|
26
|
+
devShell = pkgs.mkShell {
|
27
|
+
buildInputs = [ pkgs.ruby env pkgs.bundix ];
|
28
|
+
};
|
29
|
+
}
|
30
|
+
);
|
31
|
+
}
|
data/gemset.nix
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
{
|
2
|
+
diff-lcs = {
|
3
|
+
groups = ["default" "development"];
|
4
|
+
platforms = [];
|
5
|
+
source = {
|
6
|
+
remotes = ["https://rubygems.org"];
|
7
|
+
sha256 = "0rwvjahnp7cpmracd8x732rjgnilqv2sx7d1gfrysslc3h039fa9";
|
8
|
+
type = "gem";
|
9
|
+
};
|
10
|
+
version = "1.5.0";
|
11
|
+
};
|
12
|
+
google-protobuf = {
|
13
|
+
groups = ["default"];
|
14
|
+
platforms = [];
|
15
|
+
source = {
|
16
|
+
remotes = ["https://rubygems.org"];
|
17
|
+
sha256 = "18d1w5j7vjaza3v1ig9j7zyis04kxqdkb1272vbgncxn03ck45mm";
|
18
|
+
type = "gem";
|
19
|
+
};
|
20
|
+
version = "3.25.0";
|
21
|
+
};
|
22
|
+
pg_query = {
|
23
|
+
dependencies = ["google-protobuf"];
|
24
|
+
groups = ["default"];
|
25
|
+
platforms = [];
|
26
|
+
source = {
|
27
|
+
remotes = ["https://rubygems.org"];
|
28
|
+
sha256 = "15ynrzqsmmbmxib8ri8n9k6z3l6rwd91j7y1mghm33nfgdf9bj8w";
|
29
|
+
type = "gem";
|
30
|
+
};
|
31
|
+
version = "4.2.3";
|
32
|
+
};
|
33
|
+
rake = {
|
34
|
+
groups = ["development"];
|
35
|
+
platforms = [];
|
36
|
+
source = {
|
37
|
+
remotes = ["https://rubygems.org"];
|
38
|
+
sha256 = "1ilr853hawi09626axx0mps4rkkmxcs54mapz9jnqvpnlwd3wsmy";
|
39
|
+
type = "gem";
|
40
|
+
};
|
41
|
+
version = "13.1.0";
|
42
|
+
};
|
43
|
+
rspec = {
|
44
|
+
dependencies = ["rspec-core" "rspec-expectations" "rspec-mocks"];
|
45
|
+
groups = ["development"];
|
46
|
+
platforms = [];
|
47
|
+
source = {
|
48
|
+
remotes = ["https://rubygems.org"];
|
49
|
+
sha256 = "171rc90vcgjl8p1bdrqa92ymrj8a87qf6w20x05xq29mljcigi6c";
|
50
|
+
type = "gem";
|
51
|
+
};
|
52
|
+
version = "3.12.0";
|
53
|
+
};
|
54
|
+
rspec-core = {
|
55
|
+
dependencies = ["rspec-support"];
|
56
|
+
groups = ["default" "development"];
|
57
|
+
platforms = [];
|
58
|
+
source = {
|
59
|
+
remotes = ["https://rubygems.org"];
|
60
|
+
sha256 = "0l95bnjxdabrn79hwdhn2q1n7mn26pj7y1w5660v5qi81x458nqm";
|
61
|
+
type = "gem";
|
62
|
+
};
|
63
|
+
version = "3.12.2";
|
64
|
+
};
|
65
|
+
rspec-expectations = {
|
66
|
+
dependencies = ["diff-lcs" "rspec-support"];
|
67
|
+
groups = ["default" "development"];
|
68
|
+
platforms = [];
|
69
|
+
source = {
|
70
|
+
remotes = ["https://rubygems.org"];
|
71
|
+
sha256 = "05j44jfqlv7j2rpxb5vqzf9hfv7w8ba46wwgxwcwd8p0wzi1hg89";
|
72
|
+
type = "gem";
|
73
|
+
};
|
74
|
+
version = "3.12.3";
|
75
|
+
};
|
76
|
+
rspec-mocks = {
|
77
|
+
dependencies = ["diff-lcs" "rspec-support"];
|
78
|
+
groups = ["default" "development"];
|
79
|
+
platforms = [];
|
80
|
+
source = {
|
81
|
+
remotes = ["https://rubygems.org"];
|
82
|
+
sha256 = "1gq7gviwpck7fhp4y5ibljljvxgjklza18j62qf6zkm2icaa8lfy";
|
83
|
+
type = "gem";
|
84
|
+
};
|
85
|
+
version = "3.12.6";
|
86
|
+
};
|
87
|
+
rspec-support = {
|
88
|
+
groups = ["default" "development"];
|
89
|
+
platforms = [];
|
90
|
+
source = {
|
91
|
+
remotes = ["https://rubygems.org"];
|
92
|
+
sha256 = "1ky86j3ksi26ng9ybd7j0qsdf1lpr8mzrmn98yy9gzv801fvhsgr";
|
93
|
+
type = "gem";
|
94
|
+
};
|
95
|
+
version = "3.12.1";
|
96
|
+
};
|
97
|
+
}
|
data/lib/sqlint/version.rb
CHANGED
data/sqlint.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.name = 'sqlint'
|
9
9
|
s.version = SQLint::VERSION
|
10
10
|
s.platform = Gem::Platform::RUBY
|
11
|
-
s.required_ruby_version = '>=
|
11
|
+
s.required_ruby_version = '>= 2.7'
|
12
12
|
s.authors = ['Steve Purcell', 'Kieran Trezona-le Comte']
|
13
13
|
s.description = <<-EOF
|
14
14
|
Simple SQL linter.
|
@@ -36,8 +36,8 @@ Gem::Specification.new do |s|
|
|
36
36
|
s.rubygems_version = '1.8.23'
|
37
37
|
s.summary = 'Simple SQL linter.'
|
38
38
|
|
39
|
-
s.add_runtime_dependency('pg_query', '
|
40
|
-
s.add_development_dependency('rake', '
|
39
|
+
s.add_runtime_dependency('pg_query', '>= 1')
|
40
|
+
s.add_development_dependency('rake', '>= 12.3.3')
|
41
41
|
s.add_development_dependency('rspec', '~> 3.2')
|
42
|
-
s.add_development_dependency('bundler', '
|
42
|
+
s.add_development_dependency('bundler', '>= 2.2.33')
|
43
43
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Purcell
|
@@ -15,30 +15,30 @@ dependencies:
|
|
15
15
|
name: pg_query
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '1'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 12.3.3
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 12.3.3
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -57,16 +57,16 @@ dependencies:
|
|
57
57
|
name: bundler
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: 2.2.33
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 2.2.33
|
70
70
|
description: " Simple SQL linter.\n"
|
71
71
|
email: steve@sanityinc.com
|
72
72
|
executables:
|
@@ -77,6 +77,7 @@ extra_rdoc_files:
|
|
77
77
|
- README.md
|
78
78
|
files:
|
79
79
|
- ".github/FUNDING.yml"
|
80
|
+
- ".github/workflows/ci.yml"
|
80
81
|
- ".pre-commit-hooks.yaml"
|
81
82
|
- Gemfile.lock
|
82
83
|
- LICENSE.txt
|
@@ -84,6 +85,9 @@ files:
|
|
84
85
|
- README.md
|
85
86
|
- TODO
|
86
87
|
- bin/sqlint
|
88
|
+
- flake.lock
|
89
|
+
- flake.nix
|
90
|
+
- gemset.nix
|
87
91
|
- lib/sqlint.rb
|
88
92
|
- lib/sqlint/linter.rb
|
89
93
|
- lib/sqlint/version.rb
|
@@ -100,14 +104,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
100
104
|
requirements:
|
101
105
|
- - ">="
|
102
106
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
107
|
+
version: '2.7'
|
104
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
109
|
requirements:
|
106
110
|
- - ">="
|
107
111
|
- !ruby/object:Gem::Version
|
108
112
|
version: '0'
|
109
113
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
114
|
+
rubygems_version: 3.3.20
|
111
115
|
signing_key:
|
112
116
|
specification_version: 4
|
113
117
|
summary: Simple SQL linter.
|