finstyle 1.0.1 → 1.1.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: eeb5600cba9fae12940b3709436b5208a5159123
4
- data.tar.gz: f3c5753c338cc74f7b8096901f1eaa52ca785785
3
+ metadata.gz: 2516678794acc73b1d672039738734f59e277da8
4
+ data.tar.gz: ad965baa09e63ea6fed1d3d8a59331fbb988de84
5
5
  SHA512:
6
- metadata.gz: 7b6678252f07c278e9c6cac0ab6a1c2d5e14344a869bba7e3dd8cdd3823866c3255dfbd988f6ac341086c0f5d6e8b4cd9865ed20655a4e10a7964322da4836f8
7
- data.tar.gz: 7a65f642a4182990a786df9223a8d86ffd489395e0dabd36743d00428208a00faacb6b6b43c695540a72bbbcbfb9f0dd5168262fe99f14a2ead167a6fc327da6
6
+ metadata.gz: 490b0375853980a72bdc86fb2ea8a8fc719dddc2f387de649332983639f582060b468ce269e0e758a4ef782880442a0a95a11a127359ae450fd47bce30591971
7
+ data.tar.gz: 48bcc83bf599e376a4cca64f34bc01ab07a1d0ad8fe5d2164b94e4bfefd15bad10d1de68b6a4a65ff721cf5a29dfe949a3fb80fff3712b21798d096f86c13a35
@@ -0,0 +1,3 @@
1
+ Style/FileName:
2
+ Exclude:
3
+ - 'bin/**/*'
@@ -8,6 +8,8 @@ rvm:
8
8
  - ruby-head
9
9
  - jruby-19mode
10
10
 
11
+ bundler_args: --without guard
12
+
11
13
  matrix:
12
14
  allow_failures:
13
15
  - rvm: ruby-head
@@ -1,11 +1,28 @@
1
+ ## 1.1.0 / 2014-07-22
2
+
3
+ ### New features
4
+
5
+ * Introduce `Finstyle.config` to determine the path to YAML config file. ([@fnichol][])
6
+ * Add `finstyle-config` which outputs the full path to config YAML. ([@fnichol][])
7
+
8
+ ### Improvements
9
+
10
+ * Add more usage documentation for Guard, RuboCop command, etc. ([@fnichol][])
11
+ * Remove redundant inheritance of enabled/disabled from default.yml. ([@fnichol][])
12
+ * Add guard-rubocop support to project. ([@fnichol][])
13
+
14
+
1
15
  ## 1.0.1 / 2014-07-21
2
16
 
3
17
  ### Code changes
4
18
 
5
- * Add source encoding comments to Ruby files for better Ruby 1.9 compat. (@fnichol)
6
- * Updates to README. (@fnichol)
19
+ * Add source encoding comments to Ruby files for better Ruby 1.9 compat. ([@fnichol][])
20
+ * Updates to README. ([@fnichol][])
7
21
 
8
22
 
9
23
  ## 1.0.0 / 2014-07-21
10
24
 
11
25
  The initial release.
26
+
27
+ <!--- The following link definition list is generated by PimpMyChangelog --->
28
+ [@fnichol]: https://github.com/fnichol
data/Gemfile CHANGED
@@ -1,3 +1,7 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ group :guard do
6
+ gem "guard-rubocop"
7
+ end
@@ -0,0 +1,4 @@
1
+ guard :rubocop, keep_failed: true, cli: "-r finstyle" do
2
+ watch(%r{.+\.rb$})
3
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
4
+ end
data/README.md CHANGED
@@ -30,6 +30,22 @@ Or install it yourself as:
30
30
 
31
31
  ## Usage
32
32
 
33
+ ### Vanilla RuboCop
34
+
35
+ Run RuboCop as normal, simply add a `-r finstyle` option when running:
36
+
37
+ ```sh
38
+ rubocop -r finstyle -D --format offenses
39
+ ```
40
+
41
+ Alternatively, you can use the `finstyle-config` command to determine the path on disk to Finstyle's YAML config file:
42
+
43
+ ```sh
44
+ rubocop --config $(finstyle-config) -D --format offenses
45
+ ```
46
+
47
+ ### finstyle Command
48
+
33
49
  Use this tool just as you would RuboCop, but invoke the `finstyle` binary
34
50
  instead which patches RuboCop to load rules from the Finstyle gem. For example:
35
51
 
@@ -37,6 +53,8 @@ instead which patches RuboCop to load rules from the Finstyle gem. For example:
37
53
  finstyle -D --format offenses
38
54
  ```
39
55
 
56
+ ### Rake
57
+
40
58
  In a Rakefile, the setup is exactly the same, except you need to require the
41
59
  Finstyle library first:
42
60
 
@@ -48,6 +66,30 @@ RuboCop::RakeTask.new do |task|
48
66
  end
49
67
  ```
50
68
 
69
+ ### guard-rubocop
70
+
71
+ You can use one of two methods. The simplest is to add the `-r finstyle` option to the `:cli` option in your Guardfile:
72
+
73
+ ```ruby
74
+ guard :rubocop, cli: "-r finstyle" do
75
+ watch(%r{.+\.rb$})
76
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
77
+ end
78
+ ```
79
+
80
+ Alternatively you could pass the path to Finstyle's configuration by using the `Finstyle.config` method:
81
+
82
+ ```ruby
83
+ require "finstyle"
84
+
85
+ guard :rubocop, cli: "--config #{Finstyle.config}" do
86
+ watch(%r{.+\.rb$})
87
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
88
+ end
89
+ ```
90
+
91
+ ### .rubycop.yml
92
+
51
93
  As with vanilla RuboCop, any custom settings can still be placed in a `.rubocop.yml` file in the root of your project.
52
94
 
53
95
  ## Frequently Ask Questions
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- encoding: utf-8 -*-
3
+
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w[.. lib])
5
+
6
+ require "finstyle"
7
+
8
+ puts Finstyle.config
@@ -1,5 +1,3 @@
1
1
  inherit_from:
2
2
  - upstream.yml
3
- - enabled.yml
4
- - disabled.yml
5
3
  - finstyle.yml
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0")
18
- spec.executables = %w[finstyle]
18
+ spec.executables = %w[finstyle finstyle-config]
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
@@ -20,3 +20,13 @@ module RuboCop
20
20
  )
21
21
  end
22
22
  end
23
+
24
+ # Finstyle patches the RuboCop tool to set a new default configuration that
25
+ # is vendored in the Finstyle codebase.
26
+ module Finstyle
27
+ # @return [String] the absolute path to the main RuboCop configuration YAML
28
+ # file
29
+ def self.config
30
+ RuboCop::ConfigLoader::DEFAULT_FILE
31
+ end
32
+ end
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  module Finstyle
4
- VERSION = "1.0.1"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finstyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-21 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -85,18 +85,22 @@ email:
85
85
  - fnichol@nichol.ca
86
86
  executables:
87
87
  - finstyle
88
+ - finstyle-config
88
89
  extensions: []
89
90
  extra_rdoc_files: []
90
91
  files:
91
92
  - ".cane"
92
93
  - ".gitignore"
94
+ - ".rubocop.yml"
93
95
  - ".travis.yml"
94
96
  - CHANGELOG.md
95
97
  - Gemfile
98
+ - Guardfile
96
99
  - LICENSE.txt
97
100
  - README.md
98
101
  - Rakefile
99
102
  - bin/finstyle
103
+ - bin/finstyle-config
100
104
  - config/default.yml
101
105
  - config/disabled.yml
102
106
  - config/enabled.yml