guard-cookstyle 0.1.0 → 0.2.0

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: 4aa7c641c016b0f1678e8a9cb3e2c71894629d52
4
- data.tar.gz: 241418cd7783dbff5556abe1112fca1cfaaf9535
3
+ metadata.gz: 5f12320c9b5e0c4747e14b1a13d274e0345e5b45
4
+ data.tar.gz: '03394b2dd0bb869b209e14ae38431067d958993a'
5
5
  SHA512:
6
- metadata.gz: 50d6c01f906309a8a4f36d64c986cd9957be4c4a48c4eff4275505100fe93b138894ef389f2f05e6c00945078a86b45e8c5de18e9362552545ca916d2739f6d5
7
- data.tar.gz: d3df5e6de2cf75e3ceb56055339f6b311934e394295f9d473e819fd870918527f226348e662fd0ca3db5558a4f4527ee2124fea47de1d5af9fa09f797b90a4f3
6
+ metadata.gz: 7319497e4cd71e9ad87e9ca6d2fd39057ef2e9d7cde6b43a737b4d3744292e23bbb44c5a5539a371223be371bcf24105a5632b6ce3b9046ccb64c3d7aa127bd0
7
+ data.tar.gz: e6211d1f4086e55ea3ffc0acc9a2bdbc0ffc7a2a9f4a2fc21171a5b50217ad7d1f0a88ac85cb1ddfb0cc3b0a0ff065320b66ef4de4db624fec4e00eb6e9030c6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.2.0
4
+
5
+ I noticed there was https://github.com/chef/cookstyle#guard-rubocop, so I adjusted usage.
6
+
3
7
  ## 0.1.0
4
8
 
5
9
  - release
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Guard::Cookstyle
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/guard/cookstyle`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Gem Version](https://badge.fury.io/rb/guard-cookstyle.svg)](https://badge.fury.io/rb/guard-cookstyle)
4
4
 
5
- guard-rubocop allows you to automatically check Chef cookbook style with [Cookstyle](https://github.com/chef/cookstyle) when files are modified.
5
+ guard-cookstyle allows you to automatically check Chef cookbook style with [Cookstyle](https://github.com/chef/cookstyle) when files are modified.
6
6
 
7
7
  Cookstyle is a wrapper of rubocop, so most of the codes were based on [yujinakayama/guard-rubocop]((https://github.com/yujinakayama/guard-rubocop)).
8
8
 
@@ -32,8 +32,6 @@ Add the default Guard::Cookstyle definition to your Guardfile by running:
32
32
  $ guard init cookstyle
33
33
  ```
34
34
 
35
- Rules of Rubocop definition are loaded from `.cookstyle.yml` by default.
36
-
37
35
  ## Usage
38
36
 
39
37
  Please read the [Guard usage documentation](https://github.com/guard/guard#readme).
@@ -43,7 +41,7 @@ Please read the [Guard usage documentation](https://github.com/guard/guard#readm
43
41
  You can pass some options in `Guardfile` like the following example:
44
42
 
45
43
  ```ruby
46
- guard :cookstyle, all_on_start: false, cli: ['--format', 'clang'], cookbook_dirs: ['mycookbooks'], rubocop_config: '.rubocop.yml' do
44
+ guard :cookstyle, all_on_start: false, cli: ['--format', 'clang'], cookbook_dirs: ['mycookbooks'] do
47
45
  # ...
48
46
  end
49
47
  ```
@@ -69,20 +67,6 @@ launchy: nil # Filename to launch using Launchy after RuboCop runs.
69
67
  # default: nil
70
68
  cookbook_dirs: [] # Directory of Cookbooks to check.
71
69
  # default: %w[cookbooks site-cookbooks]
72
- rubocop_config: # Rubocop Config path.
73
- # default: '.cookstyle.yml'
74
- ```
75
-
76
- ### Tips
77
-
78
- In order to use it with Rubocop, we recommend that `.cookstyle.yml` inherits `.rubocop.yml` and add cookbook specific rules.
79
-
80
- ```
81
- ---
82
- inherit_from: .rubocop.yml
83
-
84
- ... rules for cookbooks
85
-
86
70
  ```
87
71
 
88
72
  ## Contributing
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib"]
22
22
 
23
23
  spec.add_runtime_dependency 'guard'
24
+ spec.add_runtime_dependency 'cookstyle'
24
25
 
25
26
  spec.add_development_dependency "bundler", "~> 1.16"
26
27
  spec.add_development_dependency "rake", "~> 10.0"
@@ -18,8 +18,7 @@ module Guard
18
18
  notification: :failed,
19
19
  cli: nil,
20
20
  hide_stdout: false,
21
- cookbook_dirs: %w[cookbooks site-cookbooks],
22
- rubocop_config: '.cookstyle.yml',
21
+ cookbook_dirs: %w[cookbooks site-cookbooks]
23
22
  }.merge(options)
24
23
 
25
24
  @failed_paths = []
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'cookstyle'
2
3
 
3
4
  module Guard
4
5
  class Cookstyle
@@ -32,7 +33,7 @@ module Guard
32
33
  command.concat(%w[--format progress]) # Keep default formatter for console.
33
34
  end
34
35
 
35
- command.concat(['--config', @options[:rubocop_config]])
36
+ command.concat(['--config', ::Cookstyle.config])
36
37
  command.concat(['--format', 'json', '--out', json_file_path])
37
38
  command << '--force-exclusion'
38
39
  command.concat(args_specified_by_user)
@@ -1,6 +1,7 @@
1
+ require "cookstyle"
1
2
  group :cookbooks do
2
3
  guard :cookstyle do
3
4
  watch(/(cookbooks|site-cookbooks).+\.rb$/)
4
- watch(%r{(?:.+/)?\.cookstyle(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
5
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
5
6
  end
6
7
  end
@@ -1,5 +1,5 @@
1
1
  module GuardCookstyleVersion
2
2
  def self.to_s
3
- '0.1.0'
3
+ '0.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-cookstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawanoboly
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: cookstyle
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement