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

Better directive handling #552

merged 4 commits into from Mar 6, 2016

Better directive handling #552

merged 4 commits into from Mar 6, 2016


Copy link

za-creature commented Mar 4, 2016

Closes #540


  1. Changes the semantics of coffeelint-enable:

    From: enables all rules that were previously disabled by a coffeelint-disable directive
    To: resets the ruleset to whatever was originally specified in coffeelint.json

    This is because the current implementation is buggy and mixes immutable with mutable structures. While there are ways around this, it makes the code needlessly complex and not that much useful.

    Example of existing bug

    # coffeelint: enable=no_implicit_parens
    # coffeelint: disable=no_implicit_parens
    # coffeelint: enable
    foo "bar"  # error
    # coffeelint: disable=no_implicit_parens
    # coffeelint: enable=no_implicit_parens
    # coffeelint: disable=no_implicit_parens
    # coffeelint: enable
    foo "bar"  # no error
  2. Adds the following directives that work like their parents but only for the current line

    • coffeelint-disable-line=foo,bar,baz
    • coffeelint-enable-line=foo,bar,baz
  3. Overloads coffeelint-disable to disable all registered rules. Primary use case:

    # coffeelint: disable
    do bad shit here
    # coffeelint: enable

    This contrasts with the primary use case for the parametric version which is:

    # coffeelint: disable=foo
    do shit "foo" would complain about
    # coffeelint: enable=foo
  4. Adds support for directive shortcuts. Also defines the first shortcut # noqa that expands into coffeelint: disable-line


This comment has been minimized.

Copy link

AsaAyers commented Mar 6, 2016

Thanks for adding this.

AsaAyers added a commit that referenced this pull request Mar 6, 2016
Better directive handling
@AsaAyers AsaAyers merged commit a8e7653 into clutchski:master Mar 6, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
@za-creature za-creature deleted the za-creature:noqa branch Mar 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.