Coder Social home page Coder Social logo

Comments (2)

KaanOzkan avatar KaanOzkan commented on July 26, 2024

Edit: I initially tested this in shopify core and it was working fine. I don't think it's specific to a version now. I realized now any version works properly on core. Still WIP.

I tested this on v0.3.7 and functionality is working as expected. I'll try to bisect the specific commit that introduced this. Nothing stood out to me on first glance.

Output on 0.3.7:

λ rubocop -a test.rb
Inspecting 1 file
C

Offenses:

test.rb:1:1: C: [Corrected] Sorbet/EnforceSigilOrder: Magic comments should be in the following order: typed, encoding, warn_indent, frozen_string_literal.
# frozen_string_literal: true
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.rb:1:1: C: [Corrected] Sorbet/FalseSigil: No Sorbet sigil found in file. Try a typed: false to start (you can also use rubocop -a to automatically add this).
class ThisTest
^^^^^
test.rb:1:1: C: [Corrected] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
class ThisTest
^
test.rb:2:1: C: [Corrected] Sorbet/EnforceSigilOrder: Magic comments should be in the following order: typed, encoding, warn_indent, frozen_string_literal.
# typed: false
^^^^^^^^^^^^^^

1 file inspected, 4 offenses detected, 4 offenses corrected

# typed: false
# frozen_string_literal: true
class ThisTest
  THIS_TEST = true
end

from rubocop-sorbet.

KaanOzkan avatar KaanOzkan commented on July 26, 2024

Team found out that this was due to the new version of Rubocop being used. There was a significant change in Rubocop at version 0.87 for Lint/FrozenStringLiterals. As a result bundle exec rubocop -a no longer fixes these errors as the autocorrect is deemed "unsafe". You should use bundle exec rubocop -A. (Consider inserting it within the dev style alias since this can be easily missed)

Ref: rubocop/rubocop#8360 (comment) and rubocop/rubocop#8529 is the PR that made the change.

Closing this issue as it's not rubocop-sorbet specific.

from rubocop-sorbet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.