Ruby

Ruby

Made by DeepSource

Duplicate magic comment found RB-W1008

Bug risk
Major
Autofix

Having duplicate magic comments can lead to potential bug-risks, as a duplicate magic comment can have a different argument passed to it which can change the behavior of the program or even cause it to crash.

Bad practice

# frozen_string_literal: true
# frozen_string_literal: false

# encoding: utf-8
# ...
# encoding: ascii

Recommended

# frozen_string_literal: true

# encoding: utf-8

References

  1. Magic comments in Ruby