finstyle 1.0.1 → 1.1.0
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/.rubocop.yml +3 -0
- data/.travis.yml +2 -0
- data/CHANGELOG.md +19 -2
- data/Gemfile +5 -1
- data/Guardfile +4 -0
- data/README.md +42 -0
- data/bin/finstyle-config +8 -0
- data/config/default.yml +0 -2
- data/finstyle.gemspec +1 -1
- data/lib/finstyle.rb +10 -0
- data/lib/finstyle/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2516678794acc73b1d672039738734f59e277da8
|
4
|
+
data.tar.gz: ad965baa09e63ea6fed1d3d8a59331fbb988de84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 490b0375853980a72bdc86fb2ea8a8fc719dddc2f387de649332983639f582060b468ce269e0e758a4ef782880442a0a95a11a127359ae450fd47bce30591971
|
7
|
+
data.tar.gz: 48bcc83bf599e376a4cca64f34bc01ab07a1d0ad8fe5d2164b94e4bfefd15bad10d1de68b6a4a65ff721cf5a29dfe949a3fb80fff3712b21798d096f86c13a35
|
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -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
data/Guardfile
ADDED
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
|
data/bin/finstyle-config
ADDED
data/config/default.yml
CHANGED
data/finstyle.gemspec
CHANGED
@@ -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
|
|
data/lib/finstyle.rb
CHANGED
@@ -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
|
data/lib/finstyle/version.rb
CHANGED
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
|
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-
|
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
|