rubocop-crystal 0.0.1 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da6ff9b5f99f7f17858b981c4ade0ae98dd8952b8fb2418c786f883b1e46b0fd
4
- data.tar.gz: da72279b406edb2637e76d029b8a8b8242a81baa7e47b5b6fdf2a73046b30d94
3
+ metadata.gz: bbaf055e01ff70c7c189f9b6a73c94bf6ffbc50d7c0a335103177b5b8b52fb4a
4
+ data.tar.gz: ff97d8c93dd042f6dc9288a4adc97dc975c953fda4cc3e4c4af3b7ca7b8fb795
5
5
  SHA512:
6
- metadata.gz: b418ac09e30e0c12d7c3fa70968d27cdc313275eeb30a798b74320aa808cf72478a5c32c000d259938fb1b776976732c7aef88cb4ff9fd90b4c668b4fcaaad9d
7
- data.tar.gz: 8d48ac6beabda86bcc801b91eaab3479f62c9b437725349215ad50dbbee3bc013823a9bea22d8fe75a615adb63465ee20cb501cef4556c0959fc78abfd8fa9b8
6
+ metadata.gz: 479c9f1a1c18e2147ebbbc22e8c4aa77d683e5601653d3ddbfa565ba7bee08d94aef3b92e1fabe41afcd5250a529a0a36672623db22a4206e840a40176d7fa4e
7
+ data.tar.gz: 262807664ebcfa6e7ae82af586e2c1535378184bfc20cb722932d62a6e6f75465acbd6781b79720a5cfec94460dea4ed31d55080f5192b1203b23c15ccf5b34a
@@ -0,0 +1,16 @@
1
+ name: RSpec
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - name: Download source
8
+ uses: actions/checkout@v4
9
+ - name: Install Ruby
10
+ uses: ruby/setup-ruby@v1
11
+ with:
12
+ ruby-version: '3.1.2'
13
+ - name: Install dependencies
14
+ run: gem install rspec rubocop
15
+ - name: Run spec
16
+ run: rspec
@@ -0,0 +1,16 @@
1
+ name: Rubocop
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - name: Download source
8
+ uses: actions/checkout@v4
9
+ - name: Install Ruby
10
+ uses: ruby/setup-ruby@v1
11
+ with:
12
+ ruby-version: '3.1.2'
13
+ - name: Install rubocop
14
+ run: gem install rubocop
15
+ - name: Run rubocop
16
+ run: rubocop
@@ -0,0 +1,26 @@
1
+ name: Test
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - name: Download source
8
+ uses: actions/checkout@v4
9
+ - name: Install Crystal
10
+ uses: crystal-lang/install-crystal@v1
11
+ - name: Install Ruby
12
+ uses: ruby/setup-ruby@v1
13
+ with:
14
+ ruby-version: '3.1.2'
15
+ - name: Run tests (Ruby)
16
+ run: ruby test/string.rb
17
+ - name: Install Rubocop
18
+ run: gem install rubocop
19
+ - name: Build and install rubocop-crystal
20
+ run: |
21
+ gem build rubocop-crystal
22
+ gem install rubocop-crystal
23
+ - name: Convert test files
24
+ run: rubocop --plugin rubocop-crystal -c config/default.yml --fail-level fatal -A test
25
+ - name: Run tests (Crystal)
26
+ run: crystal run test/string.cr
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,36 @@
1
+ plugins:
2
+ - rubocop-internal_affairs
3
+
4
+ AllCops:
5
+ NewCops: enable
6
+ Exclude:
7
+ - 'test/*'
8
+
9
+ Gemspec/RequireMFA:
10
+ Enabled: false
11
+
12
+ # TODO: Find out what ruby version we actually require and then remove this.
13
+ Gemspec/RequiredRubyVersion:
14
+ Enabled: false
15
+
16
+ InternalAffairs/OnSendWithoutOnCSend:
17
+ Exclude:
18
+ - 'lib/rubocop/cop/crystal/require_relative.rb'
19
+
20
+ Layout/LineLength:
21
+ Enabled: false
22
+
23
+ Metrics:
24
+ Enabled: false
25
+
26
+ Naming/FileName:
27
+ Enabled: false
28
+
29
+ Style/Documentation:
30
+ Enabled: False
31
+
32
+ Style/FrozenStringLiteralComment:
33
+ Enabled: False
34
+
35
+ Style/MutableConstant:
36
+ Enabled: False
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## 0.0.3 (2025-04-28)
2
+
3
+ ### New features
4
+
5
+ * Enable Style/BlockComments cop ([@zopolis4][])
6
+ * Enable Style/WhileUntilDo cop ([@zopolis4][])
7
+ * Add Crystal/MethodNameStartingWithUppercaseLetter cop ([@zopolis4][])
8
+
9
+ ### Changes
10
+
11
+ * Convert to Rubocop plugin ([@zopolis4][])
12
+
13
+ ## 0.0.2 (2024-08-01)
14
+
15
+ ### New features
16
+
17
+ * Enable Style/StringLiterals cop ([@zopolis4][])
18
+ * Enable Style/MethodDefParentheses cop ([@zopolis4][])
19
+ * Enable Lint/ImplicitStringConcatenation cop ([@zopolis4][])
20
+ * Add Crystal/InterpolationInSingleQuotes cop ([@zopolis4][])
21
+ * Add Crystal/RequireRelative cop ([@zopolis4][])
22
+
1
23
  ## 0.0.1 (2024-03-25)
2
24
 
3
25
  ### New features
data/README.md CHANGED
@@ -2,21 +2,32 @@
2
2
 
3
3
  The beginnings of a RuboCop extension for converting Ruby to Crystal.
4
4
 
5
- ## Testing
5
+ ## TODO
6
6
 
7
- Right now it is being tested on [basictest/test.rb](https://github.com/ruby/ruby/blob/master/basictest/test.rb) from the Ruby tree.
7
+ Many things. In particular, how are types going to work?
8
8
 
9
- Because that only gets to line 4, and certainly doesnt get far enough to give a pass/fail number, I am only testing it locally.
9
+ Getting static type information about Ruby files isn't the difficult part, the problem is conveying this information to the Crystal compiler while still maintaining valid syntax.
10
10
 
11
- Once it supports enough to run minitest, I'll convert it into a proper testing setup.
11
+ Inserting Crystal types into Ruby code is a no-go, because that causes `Lint/Syntax` errors in RuboCop.
12
12
 
13
- ## Versioning
13
+ Possible paths foward:
14
+ - Modify the parser to accept Crystal type declarations, or at least not break on them.
15
+ - Modify Crystal to accept type declarations from `.rbs` and/or `.rbi` files.
16
+ - Modify Crystal to accept type declarations from sorbet/rbs-inline/other annotations.
17
+ - Write [Ameba](https://github.com/crystal-ameba/ameba) [extension](https://crystal-ameba.github.io/2019/07/22/how-to-write-extension/) to convert the type annotations, as it works with Crystal syntax.
18
+ - Find a way to convey type information to Crystal using valid Ruby syntax.
14
19
 
15
- The end goal is to be able to run everything inside `basictest`, `boostraptest`, and `test` from the Ruby tree.
16
-
17
- Minor versions are incremented when a directory now passes all tests (`basictest`, `test/json`).
18
-
19
- My sincere apologies to dedicated [0ver](https://0ver.org/) fans, but there will be a major release once all tests pass.
20
+ Interesting repos:
21
+ - [rbs](https://github.com/ruby/rbs)
22
+ - [steep](https://github.com/soutaro/steep)
23
+ - [sorbet](https://github.com/sorbet/sorbet)
24
+ - [tapioca](https://github.com/Shopify/tapioca)
25
+ - [parlour](https://github.com/AaronC81/parlour)
26
+ - [gloss](https://github.com/johansenja/gloss)
27
+ - [claret](https://github.com/stevegeek/claret)
28
+ - [irbs](https://github.com/diaphragm/irbs)
29
+ - [rbs-inline](https://github.com/soutaro/rbs-inline)
30
+ - [syntax-tree-rbs](https://github.com/ruby-syntax-tree/syntax_tree-rbs)
20
31
 
21
32
  ## Installation
22
33
 
@@ -27,5 +38,9 @@ gem install rubocop-crystal
27
38
  ## Usage
28
39
 
29
40
  ```
30
- rubocop --require rubocop-crystal
41
+ rubocop --plugin rubocop-crystal
31
42
  ```
43
+
44
+ Note that there are some differences between Ruby and Crystal that can be automatically resolved, while some (at least for now) require manual intervention.
45
+
46
+ If you wish to only process the autocorrectable offenses, add `--disable-uncorrectable`, while reporting only the offenses requiring manual intervention is waiting on rubocop/rubocop#13275.
data/config/default.yml CHANGED
@@ -4,4 +4,31 @@ AllCops:
4
4
  Crystal/FileExtension:
5
5
  Description: 'This cop renames files ending in `.rb` to `.cr`.'
6
6
  Enabled: true
7
- VersionAdded: '0.0.1'
7
+
8
+ Crystal/InterpolationInSingleQuotes:
9
+ Description: "This cop uses %q in place of ' if the enclosed string would be affected by interpolation."
10
+ Enabled: true
11
+
12
+ Crystal/MethodNameStartingWithUppercaseLetter:
13
+ Description: 'This cop detects method names that start with uppercase letters.'
14
+ Enabled: true
15
+
16
+ Crystal/RequireRelative:
17
+ Description: 'This cop replaces require_relative with require while maintaining behavior.'
18
+ Enabled: true
19
+
20
+ Lint/ImplicitStringConcatenation:
21
+ Enabled: true
22
+
23
+ Style/BlockComments:
24
+ Enabled: true
25
+
26
+ Style/MethodDefParentheses:
27
+ Enabled: true
28
+
29
+ Style/StringLiterals:
30
+ Enabled: true
31
+ EnforcedStyle: double_quotes
32
+
33
+ Style/WhileUntilDo:
34
+ Enabled: true
@@ -0,0 +1,35 @@
1
+ module RuboCop
2
+ module Cop
3
+ module Crystal
4
+ # In ruby, strings deliminated with single quotes do not have interpolation applied.
5
+ # Crystal does not support this, so use %q literals to replicate this functionality.
6
+ # Only do this for strings which would be affected by interpolation, and let Style/StringLiterals handle the rest.
7
+ #
8
+ # @example
9
+ # # bad
10
+ # '#{foo}'
11
+ # 'cat #{con}'
12
+ #
13
+ # # good
14
+ # %q(#{foo})
15
+ # %q(cat #{con})
16
+ #
17
+ class InterpolationInSingleQuotes < Base
18
+ extend AutoCorrector
19
+ MSG = 'Crystal does not support the use of single-quote deliminated strings to avoid interpolation.'
20
+
21
+ def on_str(node)
22
+ # We're only interested in single-quote deliminated strings.
23
+ return unless node.source.start_with?("'")
24
+ # Replace the single quotes deliminating the string with double quotes, and check if the resulting ast is still the same.
25
+ # If it is, the string doesn't have any interpolation to avoid, and we're done here.
26
+ return if node == parse("\"#{node.source[1..-2]}\"").ast
27
+
28
+ add_offense(node) do |corrector|
29
+ corrector.replace(node, "%q(#{node.source[1..-2]})")
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,30 @@
1
+ module RuboCop
2
+ module Cop
3
+ module Crystal
4
+ # Method names cannot start with uppercase letters in Crystal:
5
+ # https://crystal-lang.org/reference/latest/syntax_and_semantics/methods_and_instance_variables.html
6
+ # ^ "Method names begin with a lowercase letter and, as a convention, only use lowercase letters, underscores and numbers."
7
+ #
8
+ # @example
9
+ # # bad
10
+ # def Foo(bar)
11
+ # qux
12
+ # end
13
+ # Foo(bar)
14
+ #
15
+ # # good
16
+ # def foo(bar)
17
+ # qux
18
+ # end
19
+ # foo(bar)
20
+ #
21
+ class MethodNameStartingWithUppercaseLetter < Base
22
+ MSG = 'Method names must start with a lowecase letter in Crystal.'
23
+
24
+ def on_def(node)
25
+ add_offense(node.loc.name) if node.method_name.to_s.chr.capitalize!.nil?
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,38 @@
1
+ module RuboCop
2
+ module Cop
3
+ module Crystal
4
+ # In ruby, require_relative attempts to load the library relative to the directory of the currently executing file.
5
+ # Crystal does not have require_relative, but it has the same behavior in the form of require './foo'
6
+ #
7
+ # @example
8
+ # # bad
9
+ # require_relative 'foo'
10
+ # require_relative './bar'
11
+ # require_relative '../baz'
12
+ # require_relative '/qux'
13
+ #
14
+ # # good
15
+ # require './foo'
16
+ # require './bar'
17
+ # require '../baz'
18
+ # require '/qux'
19
+ #
20
+ class RequireRelative < Base
21
+ extend AutoCorrector
22
+ MSG = 'Crystal does not support require_relative.'
23
+ RESTRICT_ON_SEND = [:require_relative]
24
+
25
+ def on_send(node)
26
+ add_offense(node) do |corrector|
27
+ require_value = if node.first_argument.value.start_with?('.', '/')
28
+ node.first_argument.value
29
+ else
30
+ "./#{node.first_argument.value}"
31
+ end
32
+ corrector.replace(node, "require '#{require_value}'")
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1 +1,4 @@
1
1
  require_relative 'crystal/file_extension'
2
+ require_relative 'crystal/interpolation_in_single_quotes'
3
+ require_relative 'crystal/method_name_starting_with_uppercase_letter'
4
+ require_relative 'crystal/require_relative'
@@ -0,0 +1,28 @@
1
+ require 'lint_roller'
2
+
3
+ module RuboCop
4
+ module Crystal
5
+ class Plugin < LintRoller::Plugin
6
+ def about
7
+ LintRoller::About.new(
8
+ name: 'rubocop-crystal',
9
+ version: '0.0.3',
10
+ homepage: 'https://github.com/Zopolis4/rubocop-crystal',
11
+ description: 'A RuboCop extension for converting Ruby to Crystal.'
12
+ )
13
+ end
14
+
15
+ def supported?(context)
16
+ context.engine == :rubocop
17
+ end
18
+
19
+ def rules(_context)
20
+ LintRoller::Rules.new(
21
+ type: :path,
22
+ config_format: :rubocop,
23
+ value: Pathname.new(__dir__).join('../../../config/default.yml')
24
+ )
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,8 +1,6 @@
1
1
  require 'rubocop'
2
2
 
3
3
  require_relative 'rubocop/crystal'
4
- require_relative 'rubocop/crystal/inject'
5
-
6
- RuboCop::Crystal::Inject.defaults!
4
+ require_relative 'rubocop/crystal/plugin'
7
5
 
8
6
  require_relative 'rubocop/cop/crystal_cops'
@@ -1,14 +1,17 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'rubocop-crystal'
3
3
  spec.summary = 'A RuboCop extension for converting Ruby to Crystal.'
4
- spec.version = '0.0.1'
4
+ spec.version = '0.0.3'
5
5
  spec.license = 'GPL-3.0-or-later'
6
6
  spec.author = 'Zopolis4'
7
7
  spec.email = 'creatorsmithmdt@gmail.com'
8
8
  spec.homepage = 'https://github.com/Zopolis4/rubocop-crystal'
9
9
 
10
+ spec.metadata['default_lint_roller_plugin'] = 'RuboCop::Crystal::Plugin'
11
+
10
12
  spec.files = `git ls-files`.split("\n")
11
13
  spec.require_paths = ['lib']
12
14
 
13
- spec.add_runtime_dependency 'rubocop'
15
+ spec.add_dependency 'lint_roller'
16
+ spec.add_dependency 'rubocop', '>= 1.72.1'
14
17
  end
@@ -0,0 +1,30 @@
1
+ RSpec.describe RuboCop::Cop::Crystal::InterpolationInSingleQuotes, :config do
2
+ it 'does not register an offense when a non-interpolated string is in double quotes' do
3
+ expect_no_offenses(<<~RUBY)
4
+ "foo"
5
+ RUBY
6
+ end
7
+
8
+ it 'does not register an offense when an interpolated string is in double quotes' do
9
+ expect_no_offenses(<<~'RUBY')
10
+ "foo #{bar}"
11
+ RUBY
12
+ end
13
+
14
+ it 'does not register an offense when a non-interpolated string is in single quotes' do
15
+ expect_no_offenses(<<~RUBY)
16
+ 'foo'
17
+ RUBY
18
+ end
19
+
20
+ it 'registers an offense when an interpolated string is in single quotes' do
21
+ expect_offense(<<~'RUBY')
22
+ 'foo #{bar}'
23
+ ^^^^^^^^^^^^ Crystal does not support the use of single-quote deliminated strings to avoid interpolation.
24
+ RUBY
25
+
26
+ expect_correction(<<~'RUBY')
27
+ %q(foo #{bar})
28
+ RUBY
29
+ end
30
+ end
@@ -0,0 +1,35 @@
1
+ RSpec.describe RuboCop::Cop::Crystal::MethodNameStartingWithUppercaseLetter, :config do
2
+ it 'registers an offense when the first letter of a method name is capitalized' do
3
+ expect_offense(<<~RUBY)
4
+ def Foo
5
+ ^^^ Method names must start with a lowecase letter in Crystal.
6
+ bar
7
+ end
8
+ RUBY
9
+ end
10
+
11
+ it 'registers an offense when all the letters of a method name are capitalized' do
12
+ expect_offense(<<~RUBY)
13
+ def FOO
14
+ ^^^ Method names must start with a lowecase letter in Crystal.
15
+ bar
16
+ end
17
+ RUBY
18
+ end
19
+
20
+ it 'does not register an offense when the first letter of a method name is lowercase' do
21
+ expect_no_offenses(<<~RUBY)
22
+ def foo
23
+ bar
24
+ end
25
+ RUBY
26
+ end
27
+
28
+ it 'does not register an offense when the first letter of a method name is lowercase regardless of the rest of the method name' do
29
+ expect_no_offenses(<<~RUBY)
30
+ def fOO
31
+ bar
32
+ end
33
+ RUBY
34
+ end
35
+ end
@@ -0,0 +1,51 @@
1
+ RSpec.describe RuboCop::Cop::Crystal::RequireRelative, :config do
2
+ it 'registers an offense when requiring a file in the same directory' do
3
+ expect_offense(<<~RUBY)
4
+ require_relative 'foo'
5
+ ^^^^^^^^^^^^^^^^^^^^^^ Crystal does not support require_relative.
6
+ RUBY
7
+
8
+ expect_correction(<<~RUBY)
9
+ require './foo'
10
+ RUBY
11
+ end
12
+
13
+ it 'registers an offense when requiring a file path starting with ./' do
14
+ expect_offense(<<~RUBY)
15
+ require_relative './foo'
16
+ ^^^^^^^^^^^^^^^^^^^^^^^^ Crystal does not support require_relative.
17
+ RUBY
18
+
19
+ expect_correction(<<~RUBY)
20
+ require './foo'
21
+ RUBY
22
+ end
23
+
24
+ it 'registers an offense when requiring a file path starting with ../' do
25
+ expect_offense(<<~RUBY)
26
+ require_relative '../foo'
27
+ ^^^^^^^^^^^^^^^^^^^^^^^^^ Crystal does not support require_relative.
28
+ RUBY
29
+
30
+ expect_correction(<<~RUBY)
31
+ require '../foo'
32
+ RUBY
33
+ end
34
+
35
+ it 'registers an offense when requiring a file path starting with /' do
36
+ expect_offense(<<~RUBY)
37
+ require_relative '/foo'
38
+ ^^^^^^^^^^^^^^^^^^^^^^^ Crystal does not support require_relative.
39
+ RUBY
40
+
41
+ expect_correction(<<~RUBY)
42
+ require '/foo'
43
+ RUBY
44
+ end
45
+
46
+ it 'does not register an offense on non-relative requires' do
47
+ expect_no_offenses(<<~RUBY)
48
+ require '../foo'
49
+ RUBY
50
+ end
51
+ end
@@ -0,0 +1,12 @@
1
+ require 'rubocop-crystal'
2
+ require 'rubocop/rspec/support'
3
+
4
+ RSpec.configure do |config|
5
+ config.disable_monkey_patching!
6
+ config.raise_errors_for_deprecations!
7
+ config.raise_on_warning = true
8
+ config.fail_if_no_examples = true
9
+
10
+ config.order = :random
11
+ Kernel.srand config.seed
12
+ end
data/test/harness.rb ADDED
@@ -0,0 +1,41 @@
1
+ class Test
2
+ @@failed_tests = 0
3
+ @@passed_tests = 0
4
+
5
+ def self.failed_tests
6
+ @@failed_tests
7
+ end
8
+
9
+ def self.passed_tests
10
+ @@passed_tests
11
+ end
12
+
13
+ def self.assert_equal(expected, actual)
14
+ if expected == actual
15
+ @@passed_tests += 1
16
+ else
17
+ @@failed_tests += 1
18
+ puts "Assertion of equality failed:"
19
+ puts "Expected: #{expected}"
20
+ puts "Actual: #{actual}"
21
+ end
22
+ end
23
+
24
+ def self.assert_unequal(expected, actual)
25
+ if expected != actual
26
+ @@passed_tests += 1
27
+ else
28
+ @@failed_tests += 1
29
+ puts "Assertion of inequality failed:"
30
+ puts "Expected: #{expected}"
31
+ puts "Actual: #{actual}"
32
+ end
33
+ end
34
+ end
35
+
36
+ at_exit do
37
+ puts "#{Test.passed_tests} tests passed."
38
+ puts "#{Test.failed_tests} tests failed."
39
+ exit(1) if Test.failed_tests.positive?
40
+ end
41
+
data/test/string.rb ADDED
@@ -0,0 +1,38 @@
1
+ require_relative 'harness'
2
+
3
+ =begin
4
+ The Alternative Instruction Set is a relatively unknown 32-bit RISC ISA.
5
+ It is found inside certain VIA C3 CPUs, and is responsible for emulating x86 instructions.
6
+ This isn't relevant in the slightest, but I had to put something in this commment, and I think it's cool.
7
+ =end
8
+
9
+ Test.assert_equal 'foo', "foo"
10
+ Test.assert_equal 'foo'"bar", "foobar"
11
+ Test.assert_equal "foobar", "foo" + 'bar'
12
+
13
+ foo = 'bar'
14
+ Test.assert_equal '#{foo}', '#{foo}'
15
+ Test.assert_equal 'bar', "#{foo}"
16
+
17
+ Test.assert_unequal 'bar', '#{foo}'
18
+ Test.assert_unequal "#{foo}", '#{foo}'
19
+
20
+ Test.assert_equal '#{foo}'"bar", '#{foo}bar'
21
+ Test.assert_equal "#{foo}""bar", 'bar' + "bar"
22
+
23
+
24
+ Test.assert_unequal '#{1 + 1}', '2'
25
+
26
+ Test.assert_equal '#{foo}'"bar", '#{foo}bar'
27
+
28
+ i = 3
29
+
30
+ while i > 0 do
31
+ i -= 1
32
+ end
33
+ Test.assert_equal 0, i
34
+
35
+ until i > 3 do
36
+ i += 1
37
+ end
38
+ Test.assert_equal 4, i
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-crystal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zopolis4
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-05-24 00:00:00.000000000 Z
10
+ date: 2025-04-28 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: rubocop
13
+ name: lint_roller
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
@@ -24,28 +23,55 @@ dependencies:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
25
  version: '0'
27
- description:
26
+ - !ruby/object:Gem::Dependency
27
+ name: rubocop
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.72.1
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 1.72.1
28
40
  email: creatorsmithmdt@gmail.com
29
41
  executables: []
30
42
  extensions: []
31
43
  extra_rdoc_files: []
32
44
  files:
45
+ - ".github/workflows/rspec.yml"
46
+ - ".github/workflows/rubocop.yml"
47
+ - ".github/workflows/test.yml"
33
48
  - ".gitignore"
49
+ - ".rspec"
50
+ - ".rubocop.yml"
34
51
  - CHANGELOG.md
35
52
  - LICENSE
36
53
  - README.md
37
54
  - config/default.yml
38
55
  - lib/rubocop-crystal.rb
39
56
  - lib/rubocop/cop/crystal/file_extension.rb
57
+ - lib/rubocop/cop/crystal/interpolation_in_single_quotes.rb
58
+ - lib/rubocop/cop/crystal/method_name_starting_with_uppercase_letter.rb
59
+ - lib/rubocop/cop/crystal/require_relative.rb
40
60
  - lib/rubocop/cop/crystal_cops.rb
41
61
  - lib/rubocop/crystal.rb
42
- - lib/rubocop/crystal/inject.rb
62
+ - lib/rubocop/crystal/plugin.rb
43
63
  - rubocop-crystal.gemspec
64
+ - spec/rubocop/cop/crystal/interpolation_in_single_quotes_spec.rb
65
+ - spec/rubocop/cop/crystal/method_name_starting_with_uppercase_letter_spec.rb
66
+ - spec/rubocop/cop/crystal/require_relative_spec.rb
67
+ - spec/spec_helper.rb
68
+ - test/harness.rb
69
+ - test/string.rb
44
70
  homepage: https://github.com/Zopolis4/rubocop-crystal
45
71
  licenses:
46
72
  - GPL-3.0-or-later
47
- metadata: {}
48
- post_install_message:
73
+ metadata:
74
+ default_lint_roller_plugin: RuboCop::Crystal::Plugin
49
75
  rdoc_options: []
50
76
  require_paths:
51
77
  - lib
@@ -60,8 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
86
  - !ruby/object:Gem::Version
61
87
  version: '0'
62
88
  requirements: []
63
- rubygems_version: 3.4.20
64
- signing_key:
89
+ rubygems_version: 3.6.5
65
90
  specification_version: 4
66
91
  summary: A RuboCop extension for converting Ruby to Crystal.
67
92
  test_files: []
@@ -1,15 +0,0 @@
1
- module RuboCop
2
- module Crystal
3
- # Because RuboCop doesn't yet support plugins, we have to monkey patch in a bit of our configuration.
4
- module Inject
5
- def self.defaults!
6
- path = CONFIG_DEFAULT.to_s
7
- hash = ConfigLoader.send(:load_yaml_configuration, path)
8
- config = Config.new(hash, path).tap(&:make_excludes_absolute)
9
- puts "configuration from #{path}" if ConfigLoader.debug?
10
- config = ConfigLoader.merge_with_default(config, path)
11
- ConfigLoader.instance_variable_set(:@default_configuration, config)
12
- end
13
- end
14
- end
15
- end