Code quality is a cornerstone of successful software development, and effective code reviews play a vital role in maintaining it. However, as we strive to improve our code, we often encounter challenges managing outdated comments within our code review process. In this article, I'll share our journey from using Pronto to automating code quality checks using Danger with RuboCop and GitLab CI. We'll discuss the limitations of our previous approach, why we transitioned to Danger, and the steps to set up Danger effectively in your GitLab CI pipeline. Let's dive in! Before Danger Our solution used to use Pronto, but Pronto had an . So, I’ve done some research and decided to move to the Danger. issue with removing outdated comments Let's Start We need to read the . Danger documentation Perform the required actions for GilabCI. Then install . danger-rubocop Now, we need to create with the next content: ./Dangerfile github.dismiss_out_of_range_messages rubocop.lint include_cop_names: true, inline_comment: true, force_exclusion: true This config will add detailed info about a failed cop and comment. And a little more info about - this option is needed for exclusion files and other things that you in your rubocop config. force_exclusion muted Let’s Test It After testing, this solution shows that Danger has a similar issue with removing outdated comments created before fixes. You know, that comments like "UserName changed this line in version X of the diff N time ago." This is comments with a . After some research, I’ve found that the value of this key is the position of a comment in a thread (thanks Captain). because Danger skips position So, now this looks better than Pronto. First of all, we can resolve manually outdated comments (you can’t do this with Pronto comments). If you want to remove comments like this forcibly, you can do it by monkey patching and removing this check. But I don’t recommend doing this. On the other side, we can automate resolving these comments. delete_old_comments! Just add the monkey patch and use delete_old_comments! client.resolve_merge_request_discussion( ci_source.repo_slug, ci_source.pull_request_id, raw_comment['discussion_id'], resolved: true) Finally, we have a solution that will your MR from outdated rubocop comments, but, you should not use the Danger option (this will create a lot of garbage in your MR). clear remove_previous_comments Conclusion After some hacks, Danger can be used more effectively than Pronto. This solution has been in “production” for a few months, and all my teammates rated it as a better solution than previous.