standard 0.0.37

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,44 @@
1
+ require_relative "../file_finder"
2
+
3
+ module Standard
4
+ module Runners
5
+ class Help
6
+ def call(config)
7
+ puts <<-MESSAGE.gsub(/^ {10}/, "")
8
+ Usage: standardrb [--fix] [-vh] [--format <name>] [--] [FILE]...
9
+
10
+ Options:
11
+
12
+ --fix Automatically fix failures where possible
13
+ --no-fix Do not automatically fix failures
14
+ --format <name> Format output with any RuboCop formatter (e.g. "json")
15
+ -v, --version Print the version of Standard
16
+ -h, --help Print this message
17
+ FILE Files to lint [default: ./]
18
+
19
+ Standard also forwards most CLI arguments to RuboCop. To see them, run:
20
+
21
+ $ rubocop --help
22
+
23
+ While Standard only offers a few configuration options, most can be set in
24
+ a `.standard.yml` file. For full documentation, please visit:
25
+
26
+ https://github.com/testdouble/standard
27
+
28
+ Having trouble? Here's some diagnostic information:
29
+
30
+ Ruby version: #{RUBY_VERSION}
31
+ Current directory: #{Dir.pwd}
32
+ RuboCop version: #{RuboCop::Version.version}
33
+ Standard version: #{Standard::VERSION}
34
+ Standard config file: #{FileFinder.new.call(".standard.yml", Dir.pwd) || "[No file found]"}
35
+
36
+ Please report any problems (and include the above information) at the URL below:
37
+
38
+ https://github.com/testdouble/standard/issues/new
39
+
40
+ MESSAGE
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,36 @@
1
+ require "rubocop"
2
+
3
+ module Standard
4
+ module Runners
5
+ class Rubocop
6
+ def call(config)
7
+ rubocop_runner = RuboCop::Runner.new(
8
+ config.rubocop_options,
9
+ config.rubocop_config_store
10
+ )
11
+
12
+ rubocop_runner.run(config.paths).tap do |success|
13
+ print_errors_and_warnings(success, rubocop_runner)
14
+ print_corrected_code_if_fixing_stdin(config.rubocop_options)
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def print_errors_and_warnings(success, rubocop_runner)
21
+ return unless success
22
+
23
+ (rubocop_runner.warnings + rubocop_runner.errors).each do |message|
24
+ warn message
25
+ end
26
+ end
27
+
28
+ def print_corrected_code_if_fixing_stdin(rubocop_options)
29
+ return unless rubocop_options[:stdin] && rubocop_options[:auto_correct]
30
+
31
+ puts "=" * 20
32
+ print rubocop_options[:stdin]
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,9 @@
1
+ module Standard
2
+ module Runners
3
+ class Version
4
+ def call(config)
5
+ puts Standard::VERSION
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module Standard
2
+ VERSION = Gem::Version.new("0.0.37")
3
+ end
data/lib/standard.rb ADDED
@@ -0,0 +1,13 @@
1
+ require "rubocop"
2
+
3
+ require "standard/rubocop/ext"
4
+
5
+ require "standard/version"
6
+ require "standard/cli"
7
+ require "standard/railtie" if defined?(Rails)
8
+
9
+ require "standard/formatter"
10
+ require "standard/cop/semantic_blocks"
11
+
12
+ module Standard
13
+ end
data/standard.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "standard/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "standard"
7
+ spec.version = Standard::VERSION
8
+ spec.authors = ["Justin Searls"]
9
+ spec.email = ["searls@gmail.com"]
10
+
11
+ spec.summary = "Ruby Style Guide, with linter & automatic code fixer"
12
+ spec.homepage = "https://github.com/testdouble/standard"
13
+
14
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
15
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ end
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "rubocop", "~> 0.67.1"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.17"
24
+ spec.add_development_dependency "minitest", "~> 5.0"
25
+ spec.add_development_dependency "pry"
26
+ spec.add_development_dependency "rake", "~> 12.0"
27
+ spec.add_development_dependency "simplecov"
28
+ spec.add_development_dependency "gimme"
29
+ end
metadata ADDED
@@ -0,0 +1,179 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: standard
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.37
5
+ platform: ruby
6
+ authors:
7
+ - Justin Searls
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-04-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rubocop
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.67.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.67.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.17'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.17'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '12.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '12.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: gimme
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description:
112
+ email:
113
+ - searls@gmail.com
114
+ executables:
115
+ - standardrb
116
+ extensions: []
117
+ extra_rdoc_files: []
118
+ files:
119
+ - ".circleci/config.yml"
120
+ - ".gitignore"
121
+ - ".standard.yml"
122
+ - Gemfile
123
+ - Gemfile.lock
124
+ - LICENSE.txt
125
+ - README.md
126
+ - Rakefile
127
+ - bin/console
128
+ - bin/setup
129
+ - config/base.yml
130
+ - config/ruby-1.8.yml
131
+ - config/ruby-1.9.yml
132
+ - config/ruby-2.2.yml
133
+ - exe/standardrb
134
+ - lib/standard.rb
135
+ - lib/standard/builds_config.rb
136
+ - lib/standard/cli.rb
137
+ - lib/standard/cop/semantic_blocks.rb
138
+ - lib/standard/creates_config_store.rb
139
+ - lib/standard/creates_config_store/assigns_rubocop_yaml.rb
140
+ - lib/standard/creates_config_store/configures_ignored_paths.rb
141
+ - lib/standard/creates_config_store/sets_target_ruby_version.rb
142
+ - lib/standard/detects_fixability.rb
143
+ - lib/standard/file_finder.rb
144
+ - lib/standard/formatter.rb
145
+ - lib/standard/loads_runner.rb
146
+ - lib/standard/loads_yaml_config.rb
147
+ - lib/standard/merges_settings.rb
148
+ - lib/standard/parses_cli_option.rb
149
+ - lib/standard/railtie.rb
150
+ - lib/standard/rake.rb
151
+ - lib/standard/rubocop/ext.rb
152
+ - lib/standard/runners/help.rb
153
+ - lib/standard/runners/rubocop.rb
154
+ - lib/standard/runners/version.rb
155
+ - lib/standard/version.rb
156
+ - standard.gemspec
157
+ homepage: https://github.com/testdouble/standard
158
+ licenses: []
159
+ metadata: {}
160
+ post_install_message:
161
+ rdoc_options: []
162
+ require_paths:
163
+ - lib
164
+ required_ruby_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ requirements: []
175
+ rubygems_version: 3.0.1
176
+ signing_key:
177
+ specification_version: 4
178
+ summary: Ruby Style Guide, with linter & automatic code fixer
179
+ test_files: []