rubocop-no_sorbet 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ed0bab69f11db6e2b52c38183903cc55f326b194b0f4750e073f4488bacc078a
4
+ data.tar.gz: 9848c9029a8b977d40a112924d58d1df20653ba770933b36737e98b793f7baeb
5
+ SHA512:
6
+ metadata.gz: 82639211aaccd23e49f01af8f8edb011be505ef4513fd23da2038fc15c392a16db9eab9a80a792dd104ec662f4ffee6592cb3d434a091d84ed9b3a91e9d809de
7
+ data.tar.gz: 12672f704ec7a240b02f865cab8f45deb7ab3f82abeed1850ad60bfd2aec137bc98151ea9d367e9bc320c55ec056e7a0c0605147faf0d4d79e77a77d42167670
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-03-08
4
+
5
+ - Initial release
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023 Zach Ahn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # Rubocop::NoSorbet
2
+
3
+ This set of rules serves to remove Sorbet from a codebase.
4
+
5
+ I like Sorbet a lot! But sometimes, I need to remove it from a codebase.
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add rubocop-no_sorbet --require=false
12
+
13
+ ## Usage
14
+
15
+ Put this into your `.rubocop.yml`.
16
+
17
+ ```yaml
18
+ require:
19
+ - rubocop-no_rubocop
20
+ ```
21
+
22
+ You can also specify this at runtime.
23
+
24
+ ```bash
25
+ rubocop --require rubocop-no_rubocop
26
+ ```
27
+
28
+ ## Development
29
+
30
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run
31
+ `bin/rspec` to run the tests. You can also run `bin/console` for an interactive
32
+ prompt that will allow you to experiment.
33
+
34
+ To install this gem onto your local machine, run `bin/rake install`. To release
35
+ a new version, update the version number in `version.rb`, and then run
36
+ `bin/rake release`, which will create a git tag for the version, push git
37
+ commits and the created tag, and push the `.gem` file
38
+ to [rubygems.org](https://rubygems.org).
39
+
40
+ ## Contributing
41
+
42
+ Bug reports and pull requests are welcome on GitHub at
43
+ <https://github.com/zachahn/rubocop-no_sorbet>.
44
+
45
+ ## License
46
+
47
+ The gem is available as open source under the terms
48
+ of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1 @@
1
+ # Write it!
@@ -0,0 +1 @@
1
+ # frozen_string_literal: true
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The original code is from https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
4
+ # See https://github.com/rubocop/rubocop-rspec/blob/master/MIT-LICENSE.md
5
+ module RuboCop
6
+ module NoSorbet
7
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
8
+ # bit of our configuration.
9
+ module Inject
10
+ def self.defaults!
11
+ path = CONFIG_DEFAULT.to_s
12
+ hash = ConfigLoader.send(:load_yaml_configuration, path)
13
+ config = Config.new(hash, path).tap(&:make_excludes_absolute)
14
+ puts "configuration from #{path}" if ConfigLoader.debug?
15
+ config = ConfigLoader.merge_with_default(config, path)
16
+ ConfigLoader.instance_variable_set(:@default_configuration, config)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module NoSorbet
5
+ VERSION = "0.0.0"
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "no_sorbet/version"
4
+
5
+ module RuboCop
6
+ module NoSorbet
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
10
+ CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
11
+ CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
12
+
13
+ private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubocop"
4
+
5
+ require_relative "rubocop/no_sorbet"
6
+ require_relative "rubocop/no_sorbet/version"
7
+ require_relative "rubocop/no_sorbet/inject"
8
+
9
+ RuboCop::NoSorbet::Inject.defaults!
10
+
11
+ require_relative "rubocop/cop/no_sorbet_cops"
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/rubocop/no_sorbet/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rubocop-no_sorbet"
7
+ spec.version = RuboCop::NoSorbet::VERSION
8
+ spec.authors = ["Zach Ahn"]
9
+ spec.email = ["engineering@zachahn.com"]
10
+
11
+ spec.summary = "Ensure no Sorbet definitions"
12
+ spec.homepage = "https://github.com/zachahn/rubocop-no_sorbet"
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = spec.homepage
18
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(__dir__) do
23
+ Dir.glob("{{config,exe,lib,sig}/**/*,*.gemspec,{CHANGELOG,README}.md,LICENSE*}").select { |file| File.file?(file) }.sort
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ # Uncomment to register a new dependency of your gem
30
+ # spec.add_dependency "example-gem", "~> 1.0"
31
+
32
+ # For more information and examples about making a new gem, check out our
33
+ # guide at: https://bundler.io/guides/creating_gem.html
34
+
35
+ spec.add_runtime_dependency "rubocop"
36
+ end
@@ -0,0 +1,6 @@
1
+ module Rubocop
2
+ module NoSorbet
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-no_sorbet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Zach Ahn
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-04-01 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'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description:
28
+ email:
29
+ - engineering@zachahn.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - CHANGELOG.md
35
+ - LICENSE.txt
36
+ - README.md
37
+ - config/default.yml
38
+ - lib/rubocop-no_sorbet.rb
39
+ - lib/rubocop/cop/no_sorbet_cops.rb
40
+ - lib/rubocop/no_sorbet.rb
41
+ - lib/rubocop/no_sorbet/inject.rb
42
+ - lib/rubocop/no_sorbet/version.rb
43
+ - rubocop-no_sorbet.gemspec
44
+ - sig/rubocop/no_sorbet.rbs
45
+ homepage: https://github.com/zachahn/rubocop-no_sorbet
46
+ licenses:
47
+ - MIT
48
+ metadata:
49
+ homepage_uri: https://github.com/zachahn/rubocop-no_sorbet
50
+ source_code_uri: https://github.com/zachahn/rubocop-no_sorbet
51
+ changelog_uri: https://github.com/zachahn/rubocop-no_sorbet/blob/main/CHANGELOG.md
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 2.6.0
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubygems_version: 3.4.7
68
+ signing_key:
69
+ specification_version: 4
70
+ summary: Ensure no Sorbet definitions
71
+ test_files: []