Skip to content

Gitlab/MarkUsedFeatureFlags: Print debug information on STDERR

Peter Leitzen requested to merge pl-rubocop-mark-used-ff-debug into master

What does this MR do and why?

Printing on STDOUT can conflict with custom RuboCop formatters so it's safer to print to STDERR. Needed for !95366 (merged).

Additionally, we only print if rubocop -d is used instead of ENV['CI'] previously.

This also disables debugging on CI by default and reduces noise. See !95366 (comment 1066808464).

Screenshots or screen recordings

Debug Before *After
ON Screenshot_from_2022-08-30_18-39-01 Screenshot_from_2022-08-30_18-38-05
OFF Screenshot_from_2022-08-30_18-39-11 Screenshot_from_2022-08-30_18-39-11

How to set up and validate locally

## Before

CI=1 bundle exec rubocop -C false --only Gitlab/MarkUsedFeatureFlags app/models/concerns/limitable.rb
bundle exec rubocop -C false --only Gitlab/MarkUsedFeatureFlags app/models/concerns/limitable.rb

## After

bundle exec rubocop -d -C false --only Gitlab/MarkUsedFeatureFlags app/models/concerns/limitable.rb
bundle exec rubocop -C false --only Gitlab/MarkUsedFeatureFlags app/models/concerns/limitable.rb

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Leitzen

Merge request reports