Use FrozenStringLiteralComment instead of flag.

Unfortunately we cannot use `--frozen-string-literal` with Ruby 2.3 due
to https://bugs.ruby-lang.org/issues/12031 and our usage of ERB.
This commit is contained in:
Mike McQuaid 2019-04-19 15:21:16 +09:00
parent e68fc530c0
commit f76b083b91
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
3 changed files with 7 additions and 6 deletions

View File

@ -93,8 +93,7 @@ Style/ConditionalAssignment:
Style/Documentation:
Enabled: false
# we want to add this slowly and manually
# TODO: add to more files
# don't want this for formulae but re-enabled for Library/Homebrew
Style/FrozenStringLiteralComment:
Enabled: false

View File

@ -117,6 +117,11 @@ Style/DocumentationMethod:
Include:
- 'Library/Homebrew/formula.rb'
# don't want this for formulae but re-enabled for Library/Homebrew
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
# so many of these in formulae but none in here
Style/GuardClause:
Enabled: true

View File

@ -348,9 +348,6 @@ else
RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt"
fi
# Don't set this for anyone (yet)
unset HOMEBREW_FROZEN_STRING_LITERAL
if [[ -z "$HOMEBREW_RUBY_WARNINGS" ]]
then
export HOMEBREW_RUBY_WARNINGS="-W0"
@ -502,5 +499,5 @@ else
# Unshift command back into argument list (unless argument list was empty).
[[ "$HOMEBREW_ARG_COUNT" -gt 0 ]] && set -- "$HOMEBREW_COMMAND" "$@"
{ update-preinstall "$@"; exec "$HOMEBREW_RUBY_PATH" $HOMEBREW_FROZEN_STRING_LITERAL $HOMEBREW_RUBY_WARNINGS "$RUBY_DISABLE_OPTIONS" "$HOMEBREW_LIBRARY/Homebrew/brew.rb" "$@"; }
{ update-preinstall "$@"; exec "$HOMEBREW_RUBY_PATH" $HOMEBREW_RUBY_WARNINGS "$RUBY_DISABLE_OPTIONS" "$HOMEBREW_LIBRARY/Homebrew/brew.rb" "$@"; }
fi