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

Add new Lint/ConstantDefinitionInBlock cop #8707

Merged
merged 1 commit into from Sep 13, 2020

Commits on Sep 12, 2020

  1. Add new Lint/ConstantDefinitionInBlock cop

    Constants defined within a block are added to the current lexical scope,
    which means the block has no effect on where the constant is defined or
    how it can be accessed. I often see constants defined inside Rake tasks
    or RSpec `describe` blocks where the intent was clearly for them to be
    scoped to the block, but which actually leak into the top-level scope.
    eugeneius committed Sep 12, 2020
    Copy the full SHA
    d76e91e View commit details
    Browse the repository at this point in the history