Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bears: Remove leading blank line option #2893

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AkshJain99
Copy link
Member

@AkshJain99 AkshJain99 commented Mar 19, 2019

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

  • I read the commit guidelines and I've followed
    them.
  • I ran coala over my code locally. (All commits have to pass
    individually.
    It is not sufficient to have "fixup commits" on your PR,
    our bot will still report the issues for the previous commit.) You will
    likely receive a lot of bot comments and build failures if coala does not
    pass on every single commit!

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!

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file shouldn't a part of this PR.


if allow_leading_blanklines:
start_line_of_file = 1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line.

@AkshJain99
Copy link
Member Author

AkshJain99 commented Mar 19, 2019 via email

@AkshJain99 AkshJain99 force-pushed the space branch 6 times, most recently from a8082f4 to 38bbcb6 Compare March 19, 2019 21:16
Implemented a feature for spaceconsistencyBear
that control the removal of blank lines.

Closes coala#2207
@AkshJain99 AkshJain99 force-pushed the space branch 2 times, most recently from dc61555 to 8362b9b Compare March 19, 2019 21:48
@AkshJain99
Copy link
Member Author

@li-boxuan please review this

'''
spacing_helper = SpacingHelper(indent_size)
result_texts = []
additional_info_texts = []

for line_number, line in enumerate(file, start=1):
def end_blanklines():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name needs to be more meaningful.

end_line = line_number
else:
break
return end_line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your case, end_line is either False or a number. I suggest not doing this.
I would have 2 functions, has_leading_blanklines() and get_leading_blanklines_no() or similar.


self.check_invalidity(self.uut,
['\n',
' \n',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From this test case, I cannot see whether the invalidity is due to a blank line (first line), or trailing white spaces (second line).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also verify the error message.

@AkshJain99
Copy link
Member Author

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

SpaceConsistencyBear: Remove leading blank lines option
5 participants