Comments (2)
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.
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)
- `ForbidUntypedStructProps` does not work with `T::ImmutableStruct`
- Option for extra newline on autocorrection of `ValidSigil`
- Ensure documentation is up to date in CI
- Suggested cop: remove whitespace between sig and method
- Add a rule to discourage use of `T::Struct#serialize` HOT 2
- Migrate from `RuboCop::Cop::Cop` to `RuboCop::Cop::Base`
- `EnforceSignatures` cop doesn't detect `sig(:final)` HOT 2
- Publish version 1.0
- Sorbet/ConstantsFromStrings does not catch &.constantize
- Integration with the Sorbet LSP
- Sigil cops ignore double commented sigils
- Discourage references to `ActiveRecord::Associations::CollectionProxy` and other synthetic constants
- EmptyLineAfterSig does't recognize `attr` declarations
- Consider a cop to detect stubbing of `is_a?`
- Forbid defining implicit conversion methods (to_ary, to_hash, to_int, to_str) HOT 1
- ValidSigil parsing behaves differently than sorbet sigil parsing
- Sorbet/AllowIncompatibleOverride inspection error HOT 2
- Suggestion: Cop for `sig` as a single or multi-line block
- Sorbet/ForbidTStruct - autocorrect does not handle optional params without default or factory HOT 1
- Enforce parentheses around return values in signatures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubocop-sorbet.