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

Tailor disabling violations within source code is all or nothing #433

Open
danimal opened this issue Aug 5, 2016 · 1 comment
Open

Tailor disabling violations within source code is all or nothing #433

danimal opened this issue Aug 5, 2016 · 1 comment
Labels

Comments

@danimal
Copy link

danimal commented Aug 5, 2016

Tailor Version: v0.10.0

Swift Version: Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)

Platform (Mac/Linux/Windows/CI): Mac

Installation Method: Homebrew

Steps to Reproduce Issue

  1. Disable Tailor checking for a part of code with // tailor:off and // tailor:on(alternately use a single line comment at the end with // tailor:disable)
  2. All Tailor checks are disabled between the off and on or for the disable line.

Expected Behavior

Only specific checks would be disabled using code comments

Actual Behavior

All Tailor checks are disabled using code comments, limiting the effectiveness of commenting in code to disable checks. For example, using the clang compiler with Objective C a person can turn off specific checks with #pragma marks like so:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"

int a;

#pragma clang diagnostic pop

I would love to see something like this for Tailor where specific rules can be disabled:

// tailor:off upper-camel-case
class someName {

}
// tailor:on

or inline with disable:

func AnyFunctionCall() { // tailor:disable lower-camel-case
}

This way you can target very specifically the rules to exclude. This would also make sure if a line violated two or more rules the non-excluded rules would be reported too.

@adityatrivedi
Copy link
Member

Hey @danimal! We agree that this would be a really useful feature for Tailor, but we’re limited on bandwidth right now so we would appreciate contributions to implement it :)

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

No branches or pull requests

2 participants