tailor
tailor copied to clipboard
Tailor disabling violations within source code is all or nothing
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
- 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
) - All Tailor checks are disabled between the
off
andon
or for thedisable
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.
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 :)