stylr 0.0.8 → 0.0.9
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/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/bin/stylr +17 -7
- data/lib/stylr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 775df439741f94f7d34cdaa9c3724df706d754c3
|
4
|
+
data.tar.gz: c45c8d3394e925ea541baf63d0787117d5813b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71ed22808a68891bd9a7783140e1231ae1b26b54293b2b3b58a7b216a715d903de081ccd3f6d670dcd52ee3c329f8c8ee5b64dd1fcf9377b7a77e15a6be2b261
|
7
|
+
data.tar.gz: 9b68aae0b023f654a05bb640d6e8c2f31820348068b2fef4f5ea8226ccda33e72bd32b740d47b4f729ae602a26b89d3d877d333c8673cdf06aa5418999502c5a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[](https://gemnasium.com/yaaase/stylr)
|
5
5
|
<img src="https://badge.fury.io/rb/stylr.png"/>
|
6
6
|
|
7
|
-
This gem will check if source code conforms to some elements of the Github Ruby Style Guidelines (https://github.com/styleguide/ruby) - currently supporting Ruby 2.1.0 (although it may work with earlier versions)
|
7
|
+
This gem will check if source code conforms to some elements of the Github Ruby Style Guidelines (https://github.com/styleguide/ruby) - currently supporting Ruby 2.1.0 (although it may work with earlier versions). Obviously it does not check against the subjective elements of the styleguide.
|
8
8
|
|
9
9
|
Kind of raw still. Currently supports checking against the following:
|
10
10
|
|
@@ -14,8 +14,8 @@ Kind of raw still. Currently supports checking against the following:
|
|
14
14
|
* Use of the 'and' or 'or' operators (&& and || are preferred)
|
15
15
|
* Use of 'then' on a multiline if/then construct
|
16
16
|
* Spacing around parens
|
17
|
-
* Spacing around brackets
|
18
|
-
* Spacing around curly braces (this is
|
17
|
+
* Spacing around brackets
|
18
|
+
* Spacing around curly braces (this is broken when you interpolate into a regex)
|
19
19
|
* Using the keyword 'for'
|
20
20
|
* Spacing around commas
|
21
21
|
* Using tab characters instead of soft tabs
|
data/bin/stylr
CHANGED
@@ -6,6 +6,7 @@ require 'stylr'
|
|
6
6
|
module Stylr
|
7
7
|
Main {
|
8
8
|
argument('directory') {
|
9
|
+
argument_optional
|
9
10
|
description "The directory to be parsed."
|
10
11
|
cast :string
|
11
12
|
}
|
@@ -15,15 +16,24 @@ module Stylr
|
|
15
16
|
description "Check for metaprogramming violations. Defaults to false."
|
16
17
|
}
|
17
18
|
|
19
|
+
option('version') {
|
20
|
+
default false
|
21
|
+
description "Display the current version"
|
22
|
+
}
|
23
|
+
|
18
24
|
def run
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
25
|
+
if params['version'].values.first
|
26
|
+
puts "stylr version #{Stylr::VERSION}"
|
27
|
+
else
|
28
|
+
directory = params['directory'].values.first
|
29
|
+
meta = params['meta'].values.first ? true : false
|
30
|
+
dir_loader = DirLoader.new
|
31
|
+
dir_loader.load_dir(directory)
|
23
32
|
|
24
|
-
|
25
|
-
|
26
|
-
|
33
|
+
dir_loader.filenames.each do |filename|
|
34
|
+
puts "Checking #{filename}..."
|
35
|
+
FileParser.new(filename, Lint.new, true).violations?(meta)
|
36
|
+
end
|
27
37
|
end
|
28
38
|
end
|
29
39
|
}
|
data/lib/stylr/version.rb
CHANGED