linty 0.0.3

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c89c3ee77a1e97fbc4308b5d826cbdede2a7951d
4
+ data.tar.gz: eea3f61e1b0f28a34807efc48002cae6d81b4351
5
+ SHA512:
6
+ metadata.gz: 206444993bb2759c21960c619947a76dc01e0d7567839085af5493577a54016152612b99a796508baf2d4edfef2047fad63a6fc54e5ff3a0179fc823afffd100
7
+ data.tar.gz: 21d679ebe340dadceb831b22803054f2e66cf27ce32bd1944385796e9f8538e157ca498679bb400a06a56dc73b172cd13ee6051dcd09644e1c28146fabb26ad0
data/bin/linty ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'require_all'
4
+ require 'oj'
5
+
6
+ require_all 'lib/**/*.rb'
7
+
8
+ Oj.default_options = {
9
+ mode: :compat
10
+ }
11
+
12
+ analyzer = Linty::Analyzer.new
13
+ analyzer.analyze(ARGV[0]) do |offense|
14
+ puts Oj.dump(offense)
15
+ end
@@ -0,0 +1,22 @@
1
+ class Linty
2
+ class Analyzer
3
+ def initialize
4
+ @analyzers = analyzers
5
+ end
6
+
7
+ def analyze(path)
8
+ @analyzers.each do |analyzer|
9
+ analyzer.analyze(path) do |offense|
10
+ yield offense
11
+ end
12
+ end
13
+ end
14
+
15
+ def analyzers
16
+ analyzers = []
17
+ analyzers.push(SpellingAnalyzer.new)
18
+ analyzers.push(RubocopAnalyzer.new)
19
+ analyzers.push(JshintAnalyzer.new)
20
+ end
21
+ end
22
+ end