Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore test/expectations/ for sorbet #2075

Merged
merged 1 commit into from
May 21, 2024

Conversation

Earlopain
Copy link
Contributor

@Earlopain Earlopain commented May 20, 2024

A expecation currently does something like this:

def method
end

This makes it impossible to call Object.method while keeping sorbet happy. There is only one file that sorbet should know about in that folder, just move that somewhere else.

Also fixes two RuboCop offenses in that file since it was previously ignored.

[user@DESKTOP-PC ruby-lsp]$ bundle exec srb
lib/ruby_lsp/requests/support/rubocop_formatter.rb:39: Non-private call to private method method on RubyLsp::Requests::Support::RuboCopRunner https://srb.help/7031
    39 |          @diagnostic_runner.method(:"123")
                                     ^^^^^^
    test/expectations/code_actions_formatting/rubocop_multiline_string.exp.rb:1: Defined in Object here
     1 |def method
        ^^^^^^^^^^

lib/ruby_lsp/requests/support/rubocop_formatter.rb:39: Too many arguments provided for method Object#method. Expected: 0, got: 1 https://srb.help/7004
    39 |          @diagnostic_runner.method(:"123")
                                            ^^^^^^
    test/expectations/code_actions_formatting/rubocop_multiline_string.exp.rb:1: method defined here
     1 |def method
        ^^^^^^^^^^
  Autocorrect: Use -a to autocorrect
    lib/ruby_lsp/requests/support/rubocop_formatter.rb:39: Delete
    39 |          @diagnostic_runner.method(:"123")
                                            ^^^^^^
Errors: 2

Motivation

I want to inspect a methods parameters in order to call an updated RuboCop APi while staying compatible with older versions.

A expecation currently does something like this:
```rb
def method
end
```

This makes it impossible to call `Object.method` while keeping sorbet happy.
There is only one file that sorbet should know about in that folder, just move that
somewhere else.

Also fixes two RuboCop offenses in that file since it was previously ignored
@Earlopain Earlopain requested a review from a team as a code owner May 20, 2024 10:44
@Earlopain Earlopain requested review from andyw8 and st0012 May 20, 2024 10:44
@andyw8 andyw8 added the chore Chore task label May 21, 2024
@andyw8 andyw8 enabled auto-merge (squash) May 21, 2024 13:54
@andyw8 andyw8 added the server This pull request should be included in the server gem's release notes label May 21, 2024
@andyw8 andyw8 merged commit b027cfa into Shopify:main May 21, 2024
19 of 20 checks passed
@Earlopain Earlopain deleted the sorbet-ignore-expectations branch May 21, 2024 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Chore task server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants