coala / coala-bears

Bears for coala
https://coala.io/
GNU Affero General Public License v3.0
294 stars 580 forks source link

Bears: Remove leading blank line option #2893

Open AkshJain99 opened 5 years ago

AkshJain99 commented 5 years ago

Bears: Remove leading blank line option

Implemented a feature for spaceconsistencyBear that control the removal of blank lines.

Closes #2207

For short term contributors: we understand that getting your commits well defined like we require is a hard task and takes some learning. If you look to help without wanting to contribute long term there's no need for you to learn this. Just drop us a message and we'll take care of brushing up your stuff for merge!

Checklist

After you submit your pull request, DO NOT click the 'Update Branch' button. When asked for a rebase, consult coala.io/rebase instead.

Please consider helping us by reviewing other peoples pull requests as well:

The more you review, the more your score will grow at coala.io and we will review your PRs faster!

AkshJain99 commented 5 years ago

Yes I am working on it , correcting things

On Tue, 19 Mar 2019, 9:13 pm Amol Grover, notifications@github.com wrote:

@frextrite requested changes on this pull request.

In tests/go/GoImportsBearTest.py https://github.com/coala/coala-bears/pull/2893#discussion_r266955514:

@@ -1,4 +1,3 @@

This file shouldn't a part of this PR.

In bears/general/SpaceConsistencyBear.py https://github.com/coala/coala-bears/pull/2893#discussion_r266956135:

  • end_line = False
  • enumerated_zip_obj = zip(range(1, len(file) + 1),
  • file)
  • enumerated_tuple = tuple(enumerated_zip_obj)
  • for line_number, line in enumerated_tuple:
  • if replacement.strip() == '':
  • end_line = line_number
  • else:
  • break
  • return end_line
  • if allow_leading_blanklines:
  • start_line_of_file = 1

Extra blank line.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/coala/coala-bears/pull/2893#pullrequestreview-216242229, or mute the thread https://github.com/notifications/unsubscribe-auth/AcS9hycqNdUoOdhmjtpV1_RhQaiLOvHQks5vYQW7gaJpZM4b7meF .

AkshJain99 commented 5 years ago

@li-boxuan please review this

AkshJain99 commented 5 years ago

@li-boxuan thanks for the review i will submit changes soon as possible, actually i am busy in making proposal so as soon i submit that i will solve this

MaskedCarrot commented 5 years ago

hello I want to work on this issue, I am new to open source can you please guide me.