KEMBAR78
Better directive handling by za-creature · Pull Request #552 · clutchski/coffeelint · GitHub
Skip to content
This repository was archived by the owner on Oct 19, 2021. It is now read-only.

Conversation

za-creature
Copy link
Contributor

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 commented Mar 6, 2016

Thanks for adding this.

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.

2 participants