rfix 1.0.7.pre.67 → 1.0.7.pre.68

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
  SHA256:
3
- metadata.gz: 18adac7bf6bfb125c3cac54933353fb5c52a6a60854f0001afa0c5bdc69ece87
4
- data.tar.gz: 1f1656bec3253bb8d609fa35fd157d60c45510e2fc787cf44139ae39dda756f7
3
+ metadata.gz: a26f95a0567bf3581515e5f7b7acc0b020ffad71f610e64cec9314b1a128573d
4
+ data.tar.gz: f70e41c32e3fe733fda2349d83c02e77705461337da6c0b5313e763c0950a46c
5
5
  SHA512:
6
- metadata.gz: 6dac6c467ca60c677bceb2926e3f78ee86164ecda79b50a010595d40a8a5e924fa2182fbe7d90f64b5158abd36aa5b7860b107b2c2495748abfed15154da50d6
7
- data.tar.gz: 29c0aca1abaa4ba8b3d13169128f052324061709ca7c03b01296b395d6f00b8dae8e76f231bd59942a350811ed6cb9d5b8a425b37bfd32a8bd01e7b368ed16a1
6
+ metadata.gz: 325fa9f8df215013e37cb0ee1b05d969cc3c66933a52b52605bbff6a5a4061445d7bb143b05bdca7ba624a5d9aa722582df782ea211110e83fd4cecd35d3b965
7
+ data.tar.gz: 255ffb2025dd390cb83939ffa90479cdb7dcd395b9f0511f9afdda54aad56c9975662c20080b575d31d4e9b9c1a35ce3f96b02629921a39684f669210f09cae3
data/README.md CHANGED
@@ -1,39 +1,85 @@
1
1
  # Rfix [![Build Status](https://travis-ci.org/oleander/rfix-rb.svg?branch=master)](https://travis-ci.org/oleander/rfix-rb) [![Gem](https://img.shields.io/gem/dt/rfix)](https://rubygems.org/gems/rfix)
2
2
 
3
- RuboCop CLI that only complains about your latest changes
3
+ RuboCop CLI that only complains about your latest changes. Includes a RuboCop formatter with syntax highlighting and build in hyperlinks for offense documentation. Supports both linting (`rfix lint`) and the RuboCops autofix feature (`rfix local|origin|branch`) for the changes you made.
4
+
5
+ Supports the same CLI arguments as RuboCop. Run `rfix --help` for the complete list.
6
+
7
+ ![Printscreen](resources/ps.png)
4
8
 
5
9
  ## Installation
6
10
 
7
11
  ``` shell
8
- $ gem install rfix
9
- $ rfix <local|branch|origin|info|all> [--dry] [--help]
12
+ $ gem install rfix --pre
13
+ ```
14
+
15
+ ## Help
16
+
17
+ ``` shell
18
+ $ rfix branch <branch> # Fix changes made between HEAD and <branch>
19
+ $ rfix origin # Fix changes made between HEAD and origin branch
20
+ $ rfix local # Fix changes not yet pushed to upstream branch
21
+ $ rfix info # Display runtime dependencies and their versions
22
+ $ rfix all # Fix all files in this repository (not recommended)
23
+ $ rfix lint # Shortcut for 'rfix local --dry --untracked'
24
+ $ rfix # Displays this list of supported commands
10
25
  ```
11
26
 
27
+ ### Arguments
28
+
29
+ - `--dry` Turns off RuboCops autofix feature (read-only mode)
30
+ - `--help` Displays RubyCops and Rfix supported arguments
31
+ - `--list-files` List all files being passed to RubyCop
32
+ - `--untracked` Include files not tracked by git
33
+ - `--config` Configuration file, defaults to `.rubocop.yml`
34
+
12
35
  ## Development
13
36
 
14
- - `git clone https://github.com/oleander/rfix-rb`
15
- - `cd rfix-rb`
16
- - `bundle install`
17
- - `bundle exec rake setup`
18
- - `bundle exec rake local`
19
- - `bundle exec rake spec`
37
+ ### Setup
38
+
39
+ 1. Download repository
40
+ 1. `$ git clone https://github.com/oleander/rfix-rb`
41
+ 2. `$ cd rfix-rb`
42
+ 2. Downloads fixtures and run time dependencies
43
+ - `$ bundle exec rake setup`
44
+
45
+ ### Install from repository
46
+
47
+ ``` shell
48
+ $ bundle exec rake local
49
+ ```
50
+
51
+ ### Run tests
52
+
53
+ ``` shell
54
+ $ bundle exec rake spec
55
+ ```
20
56
 
21
57
  ## Overcommit
22
58
 
59
+ Add the following to your `.overcommit.yml`, then run `overcommit --install` and `overcommit --sign pre-commit`. It will lint commits not yet pushed to upstream branch everytime `git commit` is ran.
60
+
23
61
  ``` yaml
24
62
  PreCommit:
25
63
  RFix:
26
64
  enabled: true
27
- command: ["rfix", "local", "--untracked", "--dry"]
28
- description: "Lint changes since last push using RuboCop"
65
+ command: ["rfix", "lint"]
66
+ description: "Lint unchanged commits using RuboCop"
29
67
  parallelize: true
30
68
  ```
31
69
 
70
+ ### From scratch
71
+
72
+ 1. `gem install overcommit rfix`
73
+ 2. `curl https://raw.githubusercontent.com/oleander/rfix-rb/master/resouces/overcommit.yml > .overcommit.yml`
74
+ 3. `overcommit --install`
75
+ 4. `overcommit --sign pre-commit`
76
+
77
+ Run `overcommit --run` to test the new hook.
78
+
32
79
  ## Contributing
33
80
 
34
81
  Bug reports and pull requests are welcome on GitHub at https://github.com/oleander/rfix.
35
82
 
36
-
37
83
  ## License
38
84
 
39
85
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/exe/rfix CHANGED
@@ -80,7 +80,7 @@ else
80
80
  say_error_sub "\t{{bold:rfix local}} -- {{italic:Fix changes not yet pushed to upstream branch}}"
81
81
  say_error_sub "\t{{bold:rfix info}} -- {{italic:Display runtime dependencies and their versions}}"
82
82
  say_error_sub "\t{{bold:rfix all}} -- {{italic:Fix all files in this repository}} {{warning:(not recommended)}}"
83
- say_error_sub "\t{{bold:rfix lint}} -- {{italic:Shortcut for 'local --dry --untracked'}}"
83
+ say_error_sub "\t{{bold:rfix lint}} -- {{italic:Shortcut for 'local --dry --untracked'}}"
84
84
  say_error_sub "\n"
85
85
  say_error_sub "\t{{italic:Optional args: --dry --help --list-files --limit-files --config --untracked}}"
86
86
  exit 1
@@ -13,7 +13,7 @@ module Rfix::Cmd
13
13
  unless status.success?
14
14
  return yield if block_given?
15
15
 
16
- say_error "[Cmd] {{italic:#{args.join(" ")}}}"
16
+ say_error "[Cmd] {{italic:#{args.join(' ')}}}"
17
17
  say_error "[Pwd] {{italic:#{Dir.pwd}}}"
18
18
  say_error "[Err] {{error:#{err.strip}}}"
19
19
 
@@ -13,7 +13,7 @@ module Rfix::Log
13
13
  end
14
14
 
15
15
  def say_error_sub(message)
16
- CLI::UI.puts("#{message}")
16
+ CLI::UI.puts(message.to_s)
17
17
  end
18
18
 
19
19
  def say_debug(message)
@@ -18,10 +18,9 @@ module Rfix
18
18
  end
19
19
 
20
20
  def set_fail_level(lint)
21
- if
22
- if lint
23
- else
24
- @config[:fail_level] = :warning
21
+ if if lint
22
+ else
23
+ @config[:fail_level] = :warning
25
24
  end
26
25
  end
27
26
  end
@@ -40,9 +39,7 @@ module Rfix
40
39
 
41
40
  def lint_mode!
42
41
  @config[:auto_correct] = false
43
- if old?
44
- @config[:fail_level] = :warning
45
- end
42
+ @config[:fail_level] = :warning if old?
46
43
  load_untracked!
47
44
  end
48
45
 
@@ -76,9 +73,7 @@ module Rfix
76
73
  formatters: ["Rfix::Formatter"]
77
74
  }
78
75
 
79
- if old?
80
- @config[:fail_level] = :autocorrect
81
- end
76
+ @config[:fail_level] = :autocorrect if old?
82
77
  end
83
78
 
84
79
  def files
Binary file
@@ -19,16 +19,16 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.summary = "RuboCop CLI that only complains about your latest changes"
21
21
  spec.description = <<~TEXT
22
- #{spec.summary}
23
- Uses 'git diff' to determine what changes were made then runs RuboCop against them
22
+ #{spec.summary}
23
+ Uses 'git diff' to determine what changes were made then runs RuboCop against them
24
24
 
25
- $ rfix branch <branch> -- Fix changes made between HEAD and <branch>
26
- $ rfix origin -- Fix changes made between HEAD and origin branch
27
- $ rfix local -- Fix changes not yet pushed to upstream branch
28
- $ rfix info -- Display runtime dependencies and their versions
29
- $ rfix all -- Fix all files in this repository (not recommended)
25
+ $ rfix branch <branch> -- Fix changes made between HEAD and <branch>
26
+ $ rfix origin -- Fix changes made between HEAD and origin branch
27
+ $ rfix local -- Fix changes not yet pushed to upstream branch
28
+ $ rfix info -- Display runtime dependencies and their versions
29
+ $ rfix all -- Fix all files in this repository (not recommended)
30
30
 
31
- Optional args: --dry --help --list-files --limit-files --config --untracked
31
+ Optional args: --dry --help --list-files --limit-files --config --untracked
32
32
  TEXT
33
33
  spec.homepage = "https://github.com/oleander/rfix-rb"
34
34
  spec.license = "MIT"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7.pre.67
4
+ version: 1.0.7.pre.68
5
5
  platform: ruby
6
6
  authors:
7
7
  - Linus Oleander
@@ -52,14 +52,17 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.80'
55
- description: "RuboCop CLI that only complains about your latest changes\nUses 'git
56
- diff' to determine what changes were made then runs RuboCop against them\n\n\t$
57
- rfix branch <branch> -- Fix changes made between HEAD and <branch>\n\t$ rfix origin
58
- \ -- Fix changes made between HEAD and origin branch\n\t$ rfix local --
59
- Fix changes not yet pushed to upstream branch\n\t$ rfix info -- Display
60
- runtime dependencies and their versions\n\t$ rfix all -- Fix all files
61
- in this repository (not recommended)\n\nOptional args: --dry --help --list-files
62
- --limit-files --config --untracked\n"
55
+ description: |2
56
+ RuboCop CLI that only complains about your latest changes
57
+ Uses 'git diff' to determine what changes were made then runs RuboCop against them
58
+
59
+ $ rfix branch <branch> -- Fix changes made between HEAD and <branch>
60
+ $ rfix origin -- Fix changes made between HEAD and origin branch
61
+ $ rfix local -- Fix changes not yet pushed to upstream branch
62
+ $ rfix info -- Display runtime dependencies and their versions
63
+ $ rfix all -- Fix all files in this repository (not recommended)
64
+
65
+ Optional args: --dry --help --list-files --limit-files --config --untracked
63
66
  email:
64
67
  - linus@oleander.nu
65
68
  executables:
@@ -106,6 +109,7 @@ files:
106
109
  - lib/rfix/tracked_file.rb
107
110
  - lib/rfix/untracked_file.rb
108
111
  - lib/rfix/version.rb
112
+ - resources/ps.png
109
113
  - rfix.gemspec
110
114
  - vendor/cli-ui/lib/cli/ui.rb
111
115
  - vendor/cli-ui/lib/cli/ui/ansi.rb