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
merged 4 commits into from Mar 6, 2016

Conversation

Projects
None yet
2 participants
@za-creature
Contributor

za-creature commented Mar 4, 2016

Closes #540

Changes:

  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

@AsaAyers

This comment has been minimized.

Show comment
Hide comment
@AsaAyers

AsaAyers Mar 6, 2016

Collaborator

Thanks for adding this.

Collaborator

AsaAyers commented Mar 6, 2016

Thanks for adding this.

AsaAyers added a commit that referenced this pull request Mar 6, 2016

@AsaAyers AsaAyers merged commit a8e7653 into clutchski:master Mar 6, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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