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

Document safety issues #8431

Closed
marcandre opened this issue Aug 1, 2020 · 0 comments · Fixed by #10094
Closed

Document safety issues #8431

marcandre opened this issue Aug 1, 2020 · 0 comments · Fixed by #10094
Labels
documentation good first issue Easy task, suitable for newcomers to the project help wanted
Milestone

Comments

@marcandre
Copy link
Contributor

It would be nice that Cops that are not safe of have a not safe auto-correction have a section in their doc about this

E.g. for FrozenStringLiteral

=== Safety
Unsafe since any code that mutates these literals will fail:
    # bad, not safely corrected:
    str = 'hello'
    str << 'world' # => Fails if magic comment is present.

    # good
    # frozen_string_literal: true

    str = +'hello'  # Notice the '+' to obtain unfrozen litteral here
    puts str << ', world'
@marcandre marcandre added documentation good first issue Easy task, suitable for newcomers to the project help wanted labels Aug 1, 2020
@bbatsov bbatsov added this to the 1.0.0 milestone Aug 10, 2020
@bbatsov bbatsov modified the milestones: 1.0, 2.0 Nov 5, 2020
dvandersluis added a commit to dvandersluis/rubocop that referenced this issue Sep 17, 2021
bbatsov pushed a commit that referenced this issue Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation good first issue Easy task, suitable for newcomers to the project help wanted
Projects
None yet
2 participants