pronto-haml 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f3f3346d32bab421dd63876e8c5fe908893c09e5
4
+ data.tar.gz: 3d930ec9caba81323201588f41766b0b8a147bd7
5
+ SHA512:
6
+ metadata.gz: 8a784652398603d151e5517e2e21cd68ea58ba62c2b52161cea415837cc9e46c9c9450932381d8527d7e5039b3b798a52a7c018c620e4ff19ef103951b294338
7
+ data.tar.gz: 414205c065f691108bdabaee575a8cd4c443e346f2f2a0713299fa00ba3927528488249a332062e9fe22ad0e8249a7c1d8b572a2800ae49864923c06cabf65bb
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2014 Mindaugas Mozūras
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,12 @@
1
+ # Pronto runner for HAML-Lint
2
+
3
+ [![Code Climate](https://codeclimate.com/github/mmozuras/pronto-haml.png)](https://codeclimate.com/github/mmozuras/pronto-haml)
4
+ [![Build Status](https://travis-ci.org/mmozuras/pronto-haml.png)](https://travis-ci.org/mmozuras/pronto-haml)
5
+ [![Gem Version](https://badge.fury.io/rb/pronto-haml.png)](http://badge.fury.io/rb/pronto-haml)
6
+ [![Dependency Status](https://gemnasium.com/mmozuras/pronto-haml.png)](https://gemnasium.com/mmozuras/pronto-haml)
7
+
8
+ Pronto runner for [HAML-Lint](https://github.com/causes/haml), tool for writing clean and consistent HAML. [What is Pronto?](https://github.com/mmozuras/pronto)
9
+
10
+ ## Configuration
11
+
12
+ Configuring HAML-Lint via .haml-lint.yml will work just fine with pronto-haml.
@@ -0,0 +1,30 @@
1
+ require 'pronto'
2
+ require 'haml_lint'
3
+
4
+ module Pronto
5
+ class Haml < Runner
6
+ def initialize
7
+ @runner = ::HamlLint::Runner.new
8
+ end
9
+
10
+ def run(patches, _)
11
+ return [] unless patches
12
+
13
+ valid_patches = patches.select { |patch| patch.additions > 0 }
14
+ valid_patches.map { |patch| inspect(patch) }.flatten.compact
15
+ end
16
+
17
+ def inspect(patch)
18
+ lints = @runner.run(files: [patch.new_file_full_path]).lints
19
+ lints.map do |lint|
20
+ patch.added_lines.select { |line| line.new_lineno == lint.line }
21
+ .map { |line| new_message(lint, line) }
22
+ end
23
+ end
24
+
25
+ def new_message(lint, line)
26
+ path = line.patch.delta.new_file[:path]
27
+ Message.new(path, line, lint.severity, lint.message)
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ module Pronto
2
+ module HamlLintVersion
3
+ VERSION = '0.2.0'
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pronto-haml
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Mindaugas Mozūras
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: haml-lint
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.0
20
+ - - '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 0.6.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.6.0
30
+ - - '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 0.6.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: pronto
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: '0.2'
40
+ - - '>='
41
+ - !ruby/object:Gem::Version
42
+ version: 0.2.0
43
+ type: :runtime
44
+ prerelease: false
45
+ version_requirements: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ version: '0.2'
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: 0.2.0
53
+ - !ruby/object:Gem::Dependency
54
+ name: rake
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ version: '10.1'
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 10.1.0
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '10.1'
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: 10.1.0
73
+ - !ruby/object:Gem::Dependency
74
+ name: rspec
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ~>
78
+ - !ruby/object:Gem::Version
79
+ version: '2.14'
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: 2.14.0
83
+ type: :development
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '2.14'
90
+ - - '>='
91
+ - !ruby/object:Gem::Version
92
+ version: 2.14.0
93
+ description:
94
+ email: mindaugas.mozuras@gmail.com
95
+ executables: []
96
+ extensions: []
97
+ extra_rdoc_files: []
98
+ files:
99
+ - LICENSE
100
+ - README.md
101
+ - lib/pronto/haml.rb
102
+ - lib/pronto/haml/version.rb
103
+ homepage: http://github.org/mmozuras/pronto-haml
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: '0'
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - '>='
119
+ - !ruby/object:Gem::Version
120
+ version: 1.3.6
121
+ requirements: []
122
+ rubyforge_project:
123
+ rubygems_version: 2.3.0
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: Pronto runner for HAML-Lint, tool for writing clean and consistent HAML
127
+ test_files: []
128
+ has_rdoc: