salt-lint 0.1.4.1 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06b6748f8fb4a05737347e3b730b460e62804f43
4
- data.tar.gz: 916bad67abd80bc6f01e3ceb4ac0669a7d03e8f4
3
+ metadata.gz: 64cff37efa283f96ccfc9e4b6e0f301a816f2053
4
+ data.tar.gz: 257598de3195caa29c5008ce76953a4475d53f79
5
5
  SHA512:
6
- metadata.gz: 56db23b66967baa8f52f5e0b121c4dbae2a59afcd3c9f45e54bf63bf3b7f449b733605ea07e088f05f949bb4478933e47878b841e49ffcce163a58052196f55e
7
- data.tar.gz: 6f7b73c95725063538f928039062ede88e123c49abde456627a676221728773781393cb5fdae94ed2b06bce599388d11f6d82f78bb68cfed4c2f387398110cc5
6
+ metadata.gz: dfe0e03dfe2b2ff44fb0f2fba074952c54e329339d229dcdb2bbdb5eab9ff8f10a843779516d94ab4a886c0a3922894ff7d62fb46a87f9e40f791104bd6f5cbe
7
+ data.tar.gz: 9da5f440c80eb1bbfe65008a2c59b6b57fe3d9836c26d6e6661481c1d7c122cc8465e533db5839d7766c7b2186cf775f4c4e63c405f84043f47a97fd130ac492
data/.gitignore CHANGED
@@ -1,4 +1,6 @@
1
1
  *.lock
2
2
  .DS_Store
3
3
  *.gem
4
- *.swp
4
+ *.swp
5
+ .bundle
6
+ .vendor
data/Gemfile CHANGED
@@ -7,4 +7,5 @@ end
7
7
  gem 'colorize'
8
8
  gem 'aruba-rspec'
9
9
  gem 'trollop'
10
- gem 'awesome_print'
10
+ gem 'awesome_print'
11
+ gem 'rake'
data/README.md CHANGED
@@ -6,7 +6,7 @@ Master: [![Master: Build Status](https://api.shippable.com/projects/551cfc825ab6
6
6
  Development: [![Development: Build Status](https://api.shippable.com/projects/551cfc825ab6cc1352b491b3/badge?branchName=development)](https://app.shippable.com/projects/551cfc825ab6cc1352b491b3/builds/latest)
7
7
 
8
8
 
9
- [![Gem Version](https://badge.fury.io/rb/salt-lint.svg)](http://badge.fury.io/rb/salt-lint)
9
+ [![Gem Version](https://badge.fury.io/rb/salt-lint.svg)](http://badge.fury.io/rb/salt-lint)
10
10
  [![Code Climate](https://codeclimate.com/github/lukaszraczylo/salt-lint/badges/gpa.svg)](https://codeclimate.com/github/lukaszraczylo/salt-lint)
11
11
  [![Gratipay](https://img.shields.io/gratipay/lukaszraczylo.svg)](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.
@@ -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
 
@@ -46,4 +46,4 @@ module Printer
46
46
  # Kill switch for error messages. Using this one to abort script run as
47
47
  # something went really wrong there.
48
48
  end
49
- end
49
+ end
@@ -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(/^\n$/) ? is_ok = true : is_ok = false
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
@@ -1,3 +1,3 @@
1
1
  module SaltLint
2
- VERSION = '0.1.4.1'
2
+ VERSION = '0.1.5'
3
3
  end
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 false
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.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: 2015-04-07 00:00:00.000000000 Z
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.4.6
154
+ rubygems_version: 2.5.1
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Salt linter written in Ruby