Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sqlint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nimrod
sqlint
Commits
5a7a004a
Commit
5a7a004a
authored
9 years ago
by
Kieran Trezona-le Comte
Browse files
Options
Downloads
Patches
Plain Diff
Limit displayed errors to 1000
parent
8469be19
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/sqlint
+3
-6
3 additions, 6 deletions
bin/sqlint
with
3 additions
and
6 deletions
bin/sqlint
+
3
−
6
View file @
5a7a004a
#!/usr/bin/env ruby
#!/usr/bin/env ruby
# What if 1000+ errors => --limit
# Split on "; -- ..."
$LOAD_PATH
.
unshift
(
File
.
dirname
(
File
.
realpath
(
__FILE__
))
+
'/../lib'
)
$LOAD_PATH
.
unshift
(
File
.
dirname
(
File
.
realpath
(
__FILE__
))
+
'/../lib'
)
require
'pg_query'
require
'pg_query'
require
'sqlint'
require
'sqlint'
LIMIT
=
1000
if
ARGV
.
include?
(
"--version"
)
if
ARGV
.
include?
(
"--version"
)
puts
SQLint
::
VERSION
puts
SQLint
::
VERSION
exit
0
exit
0
...
@@ -32,7 +29,7 @@ end
...
@@ -32,7 +29,7 @@ end
saw_errors
=
false
saw_errors
=
false
ARGV
.
each
do
|
filename
|
ARGV
.
each
do
|
filename
|
File
.
open
(
filename
,
'r'
)
do
|
file
|
File
.
open
(
filename
,
'r'
)
do
|
file
|
results
=
SQLint
::
Linter
.
new
(
filename
,
file
).
run
results
=
SQLint
::
Linter
.
new
(
filename
,
file
).
run
.
first
(
LIMIT
)
results
.
each
do
|
lint
|
results
.
each
do
|
lint
|
message_lines
=
lint
.
message
.
split
(
"
\n
"
)
message_lines
=
lint
.
message
.
split
(
"
\n
"
)
puts
[
puts
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment