querly 1.1.0 → 1.2.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/rubocop.yml +18 -0
- data/.github/workflows/ruby.yml +8 -14
- data/.rubocop.yml +10 -0
- data/CHANGELOG.md +6 -0
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/lib/querly/cli/formatter.rb +6 -1
- data/lib/querly/node_pair.rb +1 -1
- data/lib/querly/pp/cli.rb +2 -1
- data/lib/querly/version.rb +1 -1
- data/querly.gemspec +1 -1
- metadata +4 -9
- data/.travis.yml +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3604de13f36852d57290140b9bf4e4bfeb5811ffb8dbfef054a3e0ce8e9aa47a
|
4
|
+
data.tar.gz: '09038f2030b2c6bc859cfbd7087ae62da8efd2ac4ae1e3b945741d3f65d3146b'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c2dbbd840b5eb4fa65418c4d2ab81af6154dbbac94c96d083c4f7f9d88e5447666f7d583b54f4c266f52c4f4f15d2f38210c353762c2f8c281785da161d0aec
|
7
|
+
data.tar.gz: 4fd40dc297b03b7de10e3f1bb348a553d1af355f3e6310feed4b9b8e1fe5324757684e443cb8a699952bc0ccfedcf95f072e13890b5cc838f4c2850b7ef09d58
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: RuboCop
|
2
|
+
|
3
|
+
on: pull_request
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
rubocop:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- uses: ruby/setup-ruby@v1
|
11
|
+
with:
|
12
|
+
ruby-version: 2.6
|
13
|
+
- run: gem install rubocop rubocop-rubycw --no-document
|
14
|
+
- name: Run RuboCop
|
15
|
+
shell: bash
|
16
|
+
run: |
|
17
|
+
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
|
18
|
+
rubocop | ruby -pe 'sub(/^(.+):(\d+):(\d+): (.): (.+)$/, %q{::error file=\1,line=\2,col=\3::\5})'
|
data/.github/workflows/ruby.yml
CHANGED
@@ -11,18 +11,12 @@ jobs:
|
|
11
11
|
runs-on: "ubuntu-latest"
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
|
-
|
15
|
-
- 2.6-bionic
|
16
|
-
- 2.7-bionic
|
17
|
-
- master-nightly-bionic
|
18
|
-
container:
|
19
|
-
image: rubylang/ruby:${{ matrix.container_tag }}
|
14
|
+
ruby: [2.6, 2.7, head]
|
20
15
|
steps:
|
21
|
-
- uses: actions/checkout@
|
22
|
-
-
|
23
|
-
|
24
|
-
ruby
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
bundle exec rake build test
|
16
|
+
- uses: actions/checkout@v2
|
17
|
+
- uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.ruby }}
|
20
|
+
- run: bundle install --jobs 4 --retry 3
|
21
|
+
- run: bin/setup
|
22
|
+
- run: bundle exec rake build test
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.2.0 (2020-12-15)
|
6
|
+
|
7
|
+
* Relax Thor version requirements by @y-yagi ([#85](https://github.com/soutaro/querly/pull/85))
|
8
|
+
* Fix ERB comment preprocessing by @mallowlabs ([#84](https://github.com/soutaro/querly/pull/84))
|
9
|
+
* Better error message for Ruby code syntax error by @ybiquitous ([#83](https://github.com/soutaro/querly/pull/83))
|
10
|
+
|
5
11
|
## 1.1.0 (2020-05-17)
|
6
12
|
|
7
13
|
* Fix invalid bytes sequence in UTF-8 error by @mallowlabs [#75](https://github.com/soutaro/querly/pull/75)
|
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|

|
2
|
+
|
2
3
|
# Querly - Pattern Based Checking Tool for Ruby
|
3
4
|
|
4
|
-
|
5
|
+

|
5
6
|
|
6
7
|
Querly is a query language and tool to find out method calls from Ruby programs.
|
7
8
|
Define rules to check your program with patterns to find out *bad* pieces.
|
data/Rakefile
CHANGED
data/lib/querly/cli/formatter.rb
CHANGED
@@ -46,7 +46,12 @@ module Querly
|
|
46
46
|
|
47
47
|
def script_error(path, error)
|
48
48
|
STDERR.puts Rainbow("Failed to load script: #{path}").red
|
49
|
-
|
49
|
+
|
50
|
+
if error.is_a? Parser::SyntaxError
|
51
|
+
STDERR.puts error.diagnostic.render
|
52
|
+
else
|
53
|
+
STDERR.puts error.inspect
|
54
|
+
end
|
50
55
|
end
|
51
56
|
|
52
57
|
def issue_found(script, rule, pair)
|
data/lib/querly/node_pair.rb
CHANGED
data/lib/querly/pp/cli.rb
CHANGED
@@ -82,7 +82,8 @@ module Querly
|
|
82
82
|
|
83
83
|
new_source = source.gsub(/./, ' ')
|
84
84
|
parser.ast.descendants(:erb).each do |erb_node|
|
85
|
-
|
85
|
+
indicator_node, _, code_node, = *erb_node
|
86
|
+
next if indicator_node&.loc&.source == '#'
|
86
87
|
new_source[code_node.loc.range] = code_node.loc.source
|
87
88
|
new_source[code_node.loc.range.end] = ';'
|
88
89
|
end
|
data/lib/querly/version.rb
CHANGED
data/querly.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency "slim", "~> 4.0.1"
|
32
32
|
spec.add_development_dependency "haml", "~> 5.0.4"
|
33
33
|
|
34
|
-
spec.add_dependency 'thor', ">= 0.19.0"
|
34
|
+
spec.add_dependency 'thor', ">= 0.19.0"
|
35
35
|
spec.add_dependency "parser", ">= 2.5.0"
|
36
36
|
spec.add_dependency "rainbow", ">= 2.1"
|
37
37
|
spec.add_dependency "activesupport", ">= 5.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: querly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Soutaro Matsumoto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -129,9 +129,6 @@ dependencies:
|
|
129
129
|
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: 0.19.0
|
132
|
-
- - "<"
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version: 0.21.0
|
135
132
|
type: :runtime
|
136
133
|
prerelease: false
|
137
134
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -139,9 +136,6 @@ dependencies:
|
|
139
136
|
- - ">="
|
140
137
|
- !ruby/object:Gem::Version
|
141
138
|
version: 0.19.0
|
142
|
-
- - "<"
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
version: 0.21.0
|
145
139
|
- !ruby/object:Gem::Dependency
|
146
140
|
name: parser
|
147
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,9 +203,10 @@ executables:
|
|
209
203
|
extensions: []
|
210
204
|
extra_rdoc_files: []
|
211
205
|
files:
|
206
|
+
- ".github/workflows/rubocop.yml"
|
212
207
|
- ".github/workflows/ruby.yml"
|
213
208
|
- ".gitignore"
|
214
|
-
- ".
|
209
|
+
- ".rubocop.yml"
|
215
210
|
- CHANGELOG.md
|
216
211
|
- Gemfile
|
217
212
|
- LICENSE
|