pronto-slim_lint 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile.lock +89 -0
- data/LICENSE +21 -0
- data/README.md +15 -0
- data/lib/pronto/slim_lint/version.rb +5 -0
- data/lib/pronto/slim_lint.rb +36 -0
- data/pronto-slim_lint.gemspec +42 -0
- metadata +127 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d19e39140e48e18f1f4cb0362e3339dd81a9a65b
|
4
|
+
data.tar.gz: 77ede1bb3eb6d8cf52f41117d852f20a32e8a6b9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8435c4ed2608e84bdc1a61819debde1ed8d406b9d13fadf45aa9ecd148866a31bea3b042fa1def3b978c07d021ad393f0600f3ac26410417332278e2c08305e0
|
7
|
+
data.tar.gz: 600767ed13157c7f6546ba7c08fac91046f7c186eef6cc38960199e79b111267891da3954268bff820ec65e8cadde27fc50a823f96d98e92cf3aefbbe53807c4
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pronto-slim_lint (0.1.1)
|
5
|
+
pronto (~> 0.6.0)
|
6
|
+
slim_lint (~> 0.8, >= 0.8.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.4.0)
|
12
|
+
ast (2.3.0)
|
13
|
+
diff-lcs (1.2.5)
|
14
|
+
faraday (0.9.2)
|
15
|
+
multipart-post (>= 1.2, < 3)
|
16
|
+
gitlab (3.6.1)
|
17
|
+
httparty
|
18
|
+
terminal-table
|
19
|
+
httparty (0.13.7)
|
20
|
+
json (~> 1.8)
|
21
|
+
multi_xml (>= 0.5.2)
|
22
|
+
json (1.8.3)
|
23
|
+
multi_xml (0.5.5)
|
24
|
+
multipart-post (2.0.0)
|
25
|
+
octokit (4.3.0)
|
26
|
+
sawyer (~> 0.7.0, >= 0.5.3)
|
27
|
+
parser (2.3.1.2)
|
28
|
+
ast (~> 2.2)
|
29
|
+
powerpack (0.1.1)
|
30
|
+
pronto (0.6.0)
|
31
|
+
gitlab (~> 3.6, >= 3.4.0)
|
32
|
+
octokit (~> 4.3, >= 4.1.0)
|
33
|
+
rugged (~> 0.24, >= 0.23.0)
|
34
|
+
thor (~> 0.19.0)
|
35
|
+
rainbow (2.1.0)
|
36
|
+
rake (11.2.2)
|
37
|
+
rspec (3.5.0)
|
38
|
+
rspec-core (~> 3.5.0)
|
39
|
+
rspec-expectations (~> 3.5.0)
|
40
|
+
rspec-mocks (~> 3.5.0)
|
41
|
+
rspec-core (3.5.1)
|
42
|
+
rspec-support (~> 3.5.0)
|
43
|
+
rspec-expectations (3.5.0)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.5.0)
|
46
|
+
rspec-its (1.2.0)
|
47
|
+
rspec-core (>= 3.0.0)
|
48
|
+
rspec-expectations (>= 3.0.0)
|
49
|
+
rspec-mocks (3.5.0)
|
50
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
+
rspec-support (~> 3.5.0)
|
52
|
+
rspec-support (3.5.0)
|
53
|
+
rubocop (0.41.2)
|
54
|
+
parser (>= 2.3.1.1, < 3.0)
|
55
|
+
powerpack (~> 0.1)
|
56
|
+
rainbow (>= 1.99.1, < 3.0)
|
57
|
+
ruby-progressbar (~> 1.7)
|
58
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
59
|
+
ruby-progressbar (1.8.1)
|
60
|
+
rugged (0.24.0)
|
61
|
+
sawyer (0.7.0)
|
62
|
+
addressable (>= 2.3.5, < 2.5)
|
63
|
+
faraday (~> 0.8, < 0.10)
|
64
|
+
slim (3.0.7)
|
65
|
+
temple (~> 0.7.6)
|
66
|
+
tilt (>= 1.3.3, < 2.1)
|
67
|
+
slim_lint (0.8.1)
|
68
|
+
rake (>= 10, < 12)
|
69
|
+
rubocop (>= 0.36.0)
|
70
|
+
slim (~> 3.0)
|
71
|
+
sysexits (~> 1.1)
|
72
|
+
sysexits (1.2.0)
|
73
|
+
temple (0.7.7)
|
74
|
+
terminal-table (1.6.0)
|
75
|
+
thor (0.19.1)
|
76
|
+
tilt (2.0.5)
|
77
|
+
unicode-display_width (1.1.0)
|
78
|
+
|
79
|
+
PLATFORMS
|
80
|
+
ruby
|
81
|
+
|
82
|
+
DEPENDENCIES
|
83
|
+
pronto-slim_lint!
|
84
|
+
rake (~> 11.0)
|
85
|
+
rspec (~> 3.4)
|
86
|
+
rspec-its (~> 1.2)
|
87
|
+
|
88
|
+
BUNDLED WITH
|
89
|
+
1.10.6
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 Ibrahim Awwal
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Pronto runner for Slim-lint
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/pronto-slim_lint.png)](http://badge.fury.io/rb/pronto-slim_lint)
|
4
|
+
[![Dependency Status](https://gemnasium.com/ibrahima/pronto-slim_lint.png)](https://gemnasium.com/ibrahima/pronto-slim_lint)
|
5
|
+
|
6
|
+
Pronto runner for [Slim-Lint](https://github.com/sds/slim-lint), linting utility for Slim templates. [What is Pronto?](https://github.com/mmozuras/pronto)
|
7
|
+
|
8
|
+
## Prerequisites
|
9
|
+
Pronto, slim-lint
|
10
|
+
|
11
|
+
## Configuration
|
12
|
+
|
13
|
+
Configuring Slim-lint via .slim-lint.yml should work with
|
14
|
+
pronto-slim_lint. .rubocop.yml should also be respected but I am not
|
15
|
+
sure if that is the case currently.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'pronto'
|
2
|
+
require 'slim_lint'
|
3
|
+
require 'slim_lint/runner'
|
4
|
+
|
5
|
+
module Pronto
|
6
|
+
# Pronto runner for the SlimLint linter
|
7
|
+
class SlimLint < Runner
|
8
|
+
def run
|
9
|
+
return [] unless @patches
|
10
|
+
|
11
|
+
@patches.select { |patch| patch.additions > 0 }
|
12
|
+
.select { |patch| slim_file?(patch.new_file_full_path) }
|
13
|
+
.map { |patch| inspect(patch) }
|
14
|
+
.flatten.compact
|
15
|
+
end
|
16
|
+
|
17
|
+
def inspect(patch)
|
18
|
+
runner = ::SlimLint::Runner.new
|
19
|
+
lints = runner.run(files: [patch.new_file_full_path.to_s]).lints
|
20
|
+
lints.map do |lint|
|
21
|
+
patch.added_lines.select { |line| line.new_lineno == lint.line }
|
22
|
+
.map { |line| new_message(lint, line) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def new_message(lint, line)
|
27
|
+
path = line.patch.delta.new_file[:path]
|
28
|
+
|
29
|
+
Message.new(path, line, lint.severity, lint.message, nil, self.class)
|
30
|
+
end
|
31
|
+
|
32
|
+
def slim_file?(path)
|
33
|
+
'.slim' == File.extname(path)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
4
|
+
require 'pronto/slim_lint/version'
|
5
|
+
require 'English'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = 'pronto-slim_lint'
|
9
|
+
s.version = Pronto::SlimLintVersion::VERSION
|
10
|
+
s.platform = Gem::Platform::RUBY
|
11
|
+
s.author = 'Ibrahim Awwal'
|
12
|
+
s.email = 'ibrahim.awwal@gmail.com'
|
13
|
+
s.homepage = 'http://github.org/ibrahima/pronto-slim_lint'
|
14
|
+
s.summary = <<-EOF
|
15
|
+
Pronto runner for Slim-lint, linting utility for Slim templates
|
16
|
+
EOF
|
17
|
+
|
18
|
+
s.licenses = ['MIT']
|
19
|
+
s.required_ruby_version = '>= 2.0.0'
|
20
|
+
s.rubygems_version = '1.8.23'
|
21
|
+
|
22
|
+
s.files = `git ls-files`.split($RS).reject do |file|
|
23
|
+
file =~ %r{^(?:
|
24
|
+
spec/.*
|
25
|
+
|Gemfile
|
26
|
+
|Rakefile
|
27
|
+
|\.rspec
|
28
|
+
|\.gitignore
|
29
|
+
|\.rubocop.yml
|
30
|
+
|\.travis.yml
|
31
|
+
)$}x
|
32
|
+
end
|
33
|
+
s.test_files = []
|
34
|
+
s.extra_rdoc_files = ['LICENSE', 'README.md']
|
35
|
+
s.require_paths = ['lib']
|
36
|
+
|
37
|
+
s.add_dependency('pronto', '~> 0.6.0')
|
38
|
+
s.add_dependency('slim_lint', '~> 0.8', '>= 0.8.1')
|
39
|
+
s.add_development_dependency('rake', '~> 11.0')
|
40
|
+
s.add_development_dependency('rspec', '~> 3.4')
|
41
|
+
s.add_development_dependency('rspec-its', '~> 1.2')
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pronto-slim_lint
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ibrahim Awwal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pronto
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.6.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.6.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: slim_lint
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.8'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.8.1
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.8'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.8.1
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '11.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '11.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.4'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.4'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rspec-its
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '1.2'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '1.2'
|
89
|
+
description:
|
90
|
+
email: ibrahim.awwal@gmail.com
|
91
|
+
executables: []
|
92
|
+
extensions: []
|
93
|
+
extra_rdoc_files:
|
94
|
+
- LICENSE
|
95
|
+
- README.md
|
96
|
+
files:
|
97
|
+
- Gemfile.lock
|
98
|
+
- LICENSE
|
99
|
+
- README.md
|
100
|
+
- lib/pronto/slim_lint.rb
|
101
|
+
- lib/pronto/slim_lint/version.rb
|
102
|
+
- pronto-slim_lint.gemspec
|
103
|
+
homepage: http://github.org/ibrahima/pronto-slim_lint
|
104
|
+
licenses:
|
105
|
+
- MIT
|
106
|
+
metadata: {}
|
107
|
+
post_install_message:
|
108
|
+
rdoc_options: []
|
109
|
+
require_paths:
|
110
|
+
- lib
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 2.0.0
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
requirements: []
|
122
|
+
rubyforge_project:
|
123
|
+
rubygems_version: 2.4.5.1
|
124
|
+
signing_key:
|
125
|
+
specification_version: 4
|
126
|
+
summary: Pronto runner for Slim-lint, linting utility for Slim templates
|
127
|
+
test_files: []
|