Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLab FOSSGitLab FOSS
  • Issues
  • #59758
Closed (moved) (moved)
Open
Created Apr 01, 2019 by Thong Kuah@tkuah🔴Maintainer

Add frozen_string_literal: true to specs

Danger requires frozen_string_literal: true for new .rb files

https://gitlab.com/gitlab-org/gitlab-ce/issues/47424 added the magic comment for all application files. The next major offender is spec files. Since we move spec files often, we should add this magic comment to all existing spec .rb files too.

Use this sed script which could be useful to replace:

gg -L frozen_string_literal <directory> | grep "\.rb$"  | xargs -n1 sed -i "" '1s/^/# frozen_string_literal: true\'$'\n\\'$'\n/'
Edited Apr 11, 2019 by Thong Kuah
Assignee
Assign to
Time tracking