Skip to content

Overcommit should error when environment variables are not strings #423

@binarymason

Description

@binarymason

When env variable value is a boolean...

PrePush:
  RSpec:
    enabled: true
    quiet: false
    description: 'Run RSpec test suite'
    env:
      CODE_COVERAGE: true
    command: ['bundle', 'exec', 'rspec', 'spec', '--tag', '~type:request']

Overcommit blows up.

$ git push
Running pre-push hooks
Run RSpec test suite..........................................[RSpec] FAILED
Hook raised unexpected error
no implicit conversion of true into String

When env variable is string...

PrePush:
  RSpec:
    enabled: true
    quiet: false
    description: 'Run RSpec test suite'
    env:
      CODE_COVERAGE: 'truthy' # why does this have to be a string?
    command: ['bundle', 'exec', 'rspec', 'spec', '--tag', '~type:request']

Overcommit works with no issues.

Am I missing something or does overcommit depend on having a string?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions