Skip to content
This repository has been archived by the owner. It is now read-only.

Better directive handling #552

Merged
merged 4 commits into from Mar 6, 2016
Merged

Better directive handling #552

merged 4 commits into from Mar 6, 2016

Conversation

za-creature
Copy link
Contributor

@za-creature 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
Copy link
Collaborator

@AsaAyers AsaAyers commented Mar 6, 2016

Thanks for adding this.

AsaAyers added a commit that referenced this issue Mar 6, 2016
Better directive handling
@AsaAyers AsaAyers merged commit a8e7653 into clutchski:master Mar 6, 2016
1 check passed
@za-creature za-creature deleted the noqa branch Mar 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants