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

Enable frozen_string_literal: true in logger.rb. #23

Merged
merged 1 commit into from
Mar 21, 2019

Conversation

ioquatix
Copy link
Member

Is there any reason not to do this?

@ioquatix ioquatix requested a review from sonots March 21, 2019 04:08
@ioquatix
Copy link
Member Author

@sonots what do you think of this?

@sonots
Copy link
Member

sonots commented Mar 21, 2019

I remember the frozen_string_literal: false line was introduced to all (most of) standard libraries when it was introduced into ruby.

Also, I remember that I merged .freeze patch before. You should be able to remove them

ProgName = "#{name}/#{rev}".freeze

Logically thinking, frozen_string_literal should be able to be true as long as we do not have a string mutated like a = ''; a << 'foo' (it is one example, though).
We need to examine (It looks it is okay changing to true with my hurried look).

@ioquatix
Copy link
Member Author

I cannot find any example of mutable string and all tests pass so I think this is okay.

@ioquatix
Copy link
Member Author

Because frozen_string_literal: true is only advisory, I don't believe we should remove .freeze. But please advise me on what you want and I can do it.

@ioquatix ioquatix added the enhancement New feature or request label Mar 21, 2019
Copy link
Member

@sonots sonots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unnecessary .freeze if we change to frozen_string_literal: true because they are unnecessary.

Copy link
Member

@sonots sonots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I want to make frozen_string_literal: true for all lib files in this library for consistency.

@sonots
Copy link
Member

sonots commented Mar 21, 2019

I will take care of others, let me merge.

@sonots sonots merged commit 8d6347c into master Mar 21, 2019
@sonots sonots deleted the frozen_string_literals branch March 21, 2019 16:11
@ioquatix
Copy link
Member Author

Sorry I was sleeping but everything you did looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants