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

False positive of IndentationStyle with tabs and alignment #7884

Open
AlexWayfer opened this issue Apr 17, 2020 · 7 comments
Open

False positive of IndentationStyle with tabs and alignment #7884

AlexWayfer opened this issue Apr 17, 2020 · 7 comments

Comments

@AlexWayfer
Copy link
Contributor

Hello.

I'm trying to update RuboCop to version 0.82.0 for Flame.

I'm using tabs in this project.

And there is alignment in .gemspec file:

	s.description = 'Use controller\'s classes with instance methods' \
	                ' as routing actions, mounting its in application class.'

Expected behavior

No offenses.

Actual behavior

There is offense about spaces.

Steps to reproduce the problem

Code placed above.

RuboCop version

0.82.0 (using Parser 2.7.1.1, running on ruby 2.7.1 x86_64-linux)
@AlexWayfer
Copy link
Contributor Author

Forgot to /cc @DracoAter

@DracoAter
Copy link
Contributor

Currently the cop (when EnforcedStyle: tabs) looks for spaces before any alpha-numeric in a line, expecting that there should be only indentation. But turns out there can be alignment too.

Probably we could switch the behaviour in such case to look for expected number of tabs in the beginning of the line?

@AlexWayfer
Copy link
Contributor Author

Probably we could switch the behaviour in such case to look for expected number of tabs in the beginning of the line?

Ideally, we should check a number of tabs (as indentation) and a number of spaces (alignment, relatively to the previous line). At least number of tabs relatively to the start of previous line (and left alignment to developer responsibility).

@AlexWayfer
Copy link
Contributor Author

AlexWayfer commented Jun 26, 2020

I guess here should be the ~bug label.

@stale
Copy link

stale bot commented Dec 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label Dec 24, 2020
@AlexWayfer
Copy link
Contributor Author

It's probably not too popular case, and heredocs make good job, so it can be closed probably according to RuboCop policy (if I've understood and remember it correctly).

@stale stale bot removed the stale Issues that haven't been active in a while label Dec 27, 2020
@AlexWayfer
Copy link
Contributor Author

@koic is it resolved? One of my projects got RedundantCopDisableDirective with the 1.31.1.

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

No branches or pull requests

2 participants