salt-lint 0.1.4.1 → 0.1.5
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/.gitignore +3 -1
- data/Gemfile +2 -1
- data/README.md +4 -2
- data/lib/salt-lint/options.rb +12 -2
- data/lib/salt-lint/printer.rb +1 -1
- data/lib/salt-lint/tests.rb +1 -1
- data/lib/salt-lint/version.rb +1 -1
- data/spec/tests_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64cff37efa283f96ccfc9e4b6e0f301a816f2053
|
4
|
+
data.tar.gz: 257598de3195caa29c5008ce76953a4475d53f79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfe0e03dfe2b2ff44fb0f2fba074952c54e329339d229dcdb2bbdb5eab9ff8f10a843779516d94ab4a886c0a3922894ff7d62fb46a87f9e40f791104bd6f5cbe
|
7
|
+
data.tar.gz: 9da5f440c80eb1bbfe65008a2c59b6b57fe3d9836c26d6e6661481c1d7c122cc8465e533db5839d7766c7b2186cf775f4c4e63c405f84043f47a97fd130ac492
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Master: [](https://app.shippable.com/projects/551cfc825ab6cc1352b491b3/builds/latest)
|
7
7
|
|
8
8
|
|
9
|
-
[](http://badge.fury.io/rb/salt-lint)
|
9
|
+
[](http://badge.fury.io/rb/salt-lint)
|
10
10
|
[](https://codeclimate.com/github/lukaszraczylo/salt-lint)
|
11
11
|
[](https://gratipay.com/lukaszraczylo/)
|
12
12
|
|
@@ -19,4 +19,6 @@ Please see [documentation](doc/list_tests.md) to interpret any results returned.
|
|
19
19
|
git ls-files | grep sls | xargs -I {} salt-lint -f {}
|
20
20
|
```
|
21
21
|
|
22
|
-
## Do not use it until version >= 0.5
|
22
|
+
## Do not use it until version >= 0.5
|
23
|
+
|
24
|
+
## Forked from lukaszraczylo/salt-lint and extended to return exit code > 0 if errors were found.
|
data/lib/salt-lint/options.rb
CHANGED
@@ -7,15 +7,25 @@ module SaltLint
|
|
7
7
|
# Actions based on parsed command line arguments
|
8
8
|
def self.act
|
9
9
|
# Scanning for files in
|
10
|
+
errors = 0
|
10
11
|
if $arguments.scan_given
|
11
12
|
list_of_files = SaltLint::Actions.scan
|
12
13
|
if list_of_files.count > 0
|
13
14
|
SaltLint::Actions.scan.each do |f|
|
14
|
-
SaltLint::Actions.check_rules(f)
|
15
|
+
if(!SaltLint::Actions.check_rules(f))
|
16
|
+
errors = errors+1
|
17
|
+
end
|
15
18
|
end
|
16
19
|
end
|
17
20
|
elsif $arguments.file_given
|
18
|
-
SaltLint::Actions.check_rules($arguments.file)
|
21
|
+
if(!SaltLint::Actions.check_rules($arguments.file))
|
22
|
+
errors = errors+1
|
23
|
+
end
|
24
|
+
end
|
25
|
+
puts("\n----- SUMMARY: -----")
|
26
|
+
Printer.print('warning', "Total errors found: #{errors}")
|
27
|
+
if(errors)
|
28
|
+
exit 1
|
19
29
|
end
|
20
30
|
end
|
21
31
|
|
data/lib/salt-lint/printer.rb
CHANGED
data/lib/salt-lint/tests.rb
CHANGED
@@ -37,7 +37,7 @@ module SaltLint
|
|
37
37
|
if $arguments.check_newlines
|
38
38
|
Printer.print('debug', "Checking for no-newline at the end of the file in file #{file}", 5)
|
39
39
|
f = File.readlines(file).last
|
40
|
-
f.match(
|
40
|
+
f.match(/\n$/) ? is_ok = true : is_ok = false
|
41
41
|
if ! $invalid_newline.has_key?(file) && is_ok == false
|
42
42
|
Printer.print('warning', "No newline at the end of the file #{file}")
|
43
43
|
$invalid_newline[file] = is_ok
|
data/lib/salt-lint/version.rb
CHANGED
data/spec/tests_spec.rb
CHANGED
@@ -24,7 +24,7 @@ describe 'Tests suite checks if' do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'won\'t allow to forget about newline at the end of the file' do
|
27
|
-
expect(SaltLint::Tests.check_for_no_newline(0, 0, test_file_bad)).to eq
|
27
|
+
expect(SaltLint::Tests.check_for_no_newline(0, 0, test_file_bad)).to eq true
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'won\'t allow to single word declarations' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salt-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lukasz Raczylo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.5.1
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Salt linter written in Ruby
|