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

opening_brace violation issue #1811

Closed
tungfam opened this Issue Aug 31, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@tungfam

tungfam commented Aug 31, 2017

Running v 0.22.0 and checked the created issues.

Bug Report

Here is my code:
screen shot 2017-08-31 at 12 57 47 pm

The warning says:

Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration. (opening_brace)

Adding disable rule:
screen shot 2017-08-31 at 1 00 01 pm

And got this issue:

Superfluous Disable Command Violation: SwiftLint rule 'opening_brace' did not trigger a violation in the disabled region. Please remove the disable command. (superfluous_disable_command)

Issue: There is a conflict of warning and error.

PS: though, disabling using //swiftlint:disable opening_brace works. but if use :this - having issues.

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Aug 31, 2017

Collaborator

The issue is that opening_brace rule currently does not do a very good job on reporting the location.

I'd suggest you to use one of the alternatives:

func foo()
{ // swiftlint:disable:previous opening_brace

}

// swiftlint:disable:next opening_brace
func foo()
{

}

Alternatively, you can disable superfluous_disable_command as you'd with any rule: in your configuration or with comments.

I think we should keep this open to track improving opening_brace violation locations.

Collaborator

marcelofabri commented Aug 31, 2017

The issue is that opening_brace rule currently does not do a very good job on reporting the location.

I'd suggest you to use one of the alternatives:

func foo()
{ // swiftlint:disable:previous opening_brace

}

// swiftlint:disable:next opening_brace
func foo()
{

}

Alternatively, you can disable superfluous_disable_command as you'd with any rule: in your configuration or with comments.

I think we should keep this open to track improving opening_brace violation locations.

@marcelofabri marcelofabri added the bug label Aug 31, 2017

@tungfam

This comment has been minimized.

Show comment
Hide comment
@tungfam

tungfam Aug 31, 2017

Yeah, I made a workaround. Thanks!

tungfam commented Aug 31, 2017

Yeah, I made a workaround. Thanks!

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Aug 31, 2017

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Aug 31, 2017

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