Skip to content

Conversation

thinca
Copy link

@thinca thinca commented Sep 6, 2020

Source code may have magic comments.

# frozen_string_literal: true

# == Schema Information
#
# Table name: foo
#
#  id                  :integer         not null, primary key
#  created_at          :datetime
#  updated_at          :datetime
#

class Foo < ActiveRecord::Base
end

In this case, the blank line before the annotation should not be erased by annotate --delete.

Expected:

# frozen_string_literal: true

class Foo < ActiveRecord::Base
end

But actual:

# frozen_string_literal: true
class Foo < ActiveRecord::Base
end

This change fixes it.

Source code may have magic comments.

```
# frozen_string_literal: true

# == Schema Information
#
# Table name: foo
#
#  id                  :integer         not null, primary key
#  created_at          :datetime
#  updated_at          :datetime
#

class Foo < ActiveRecord::Base
end
```

In this case, the blank line before the annotation should not be erased
by `annotate --delete`.

Expected:
```
# frozen_string_literal: true

class Foo < ActiveRecord::Base
end
```

But actual:
```
# frozen_string_literal: true
class Foo < ActiveRecord::Base
end
```

This change fixes it.
@thinca thinca force-pushed the do-not-delete-leading-empty-lines-if-annotation-at-top branch from 546a6a6 to e530e17 Compare September 6, 2020 13:29
@ctran ctran added this to the v3.2.0 milestone Mar 24, 2021
@ctran ctran modified the milestones: v3.2.0, v3.2.1 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants