Skip to content

Double empty lines after annotate comments gives Rubocop error #591

Closed
@kreintjes

Description

@kreintjes

The gem adds multiple empty lines after the annotate command in models when using the bare format. Rubocop doesn't like that (Layout/EmptyLines: Extra blank line detected). You can't even fix that with rubocop:disable in the open wrapper and rubocop:enable in the close wrapper, since the close wrapper is added before the extra whitespace.

Example output for a model account.rb:

# frozen_string_literal: true

# rubocop:disable Layout/EmptyLines
# == Schema Information
#
# Table name: accounts
#
#  id                         :integer          not null, primary key
#
# rubocop:enable Layout/EmptyLines
 
 
class Account < ApplicationRecord
  ....
end

Version

  • annotate version: 2.7.4
  • rails version: 5.2.1
  • ruby version: 2.5.1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions