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

Rework inline directives #265

Closed
wants to merge 2 commits into from
Closed

Rework inline directives #265

wants to merge 2 commits into from

Conversation

veelenga
Copy link
Member

@veelenga veelenga commented Apr 8, 2022

Closes #234

This work implements the inline directives similar to what eslint implements. The issue can be disabled in the following cases:

  1. The line of the reported location ends with ameba:disable_line directive
  2. The line above the reported location ends with ameba:disable_next_line directive
  3. Any line above the reported location ends with ameba:disable directive (and there is not directive not enable that back)

For example, in all the cases below directive disables the rule:

Time.epoch(1483859302) # ameba:disable_line Style/LargeNumbers

# ameba:disable_next_line Style/LargeNumbers
Time.epoch(1483859302)

# ameba:disable Style/LargeNumbers
Time.epoch(1483859301)
Time.epoch(1483859302)

The rule can be enabled back:

# ameba:disable Style/LargeNumbers
Time.epoch(1483859302)
# ameba:enable Style/LargeNumbers

Notes:

  • This is a little breaking change for the existed #ameba:disable directive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable rule inline over multiple lines
2 participants