-
Notifications
You must be signed in to change notification settings - Fork 740
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
Enable Rubocop ambiguity warnings #1180
Conversation
Rouge currently disables Rubocop's AmbiguousRegexpLiteral cop and its Lint/AmbiguousOperator. Presumably this was because of the large number of regular expressions used in Rouge that are defined using the `/.../` literal syntax. This commit prepends all regular expressions of that form with `%r`. It also tidies up a few uses of the `*%w()` construct that are present in the codebase. This allows these warnings to be turned on without causing any issues. It should be noted that having the warnings disabled is not a problem in and of itself. However, these constructs also raise warnings when running Ruby with the `-w` switch. Getting Rouge to a point where it can be run with the `-w` switch will allow for a safer development environment.
a4e20cd
to
754fe2a
Compare
This adds support for the Brainfuck language.
Reset the value of `@all` only if it has been defined.
The Python lexer only supported minor version numbers for shebangs involving `python2`. Minor versions of Python 3 should also be included. This commit corrects that problem and supports minor version numbers higher than 9.
If this PR is merged, I'm not sure what to do about the lexers that have been proposed in outstanding PRs and that don't use the |
Yeah, that's probably the right way forward. I need to rebase this against master to fix the Brainfuck lexer. Should be able to do that tonight. Can then merge. |
This commit allows for the Rake tasks to be run with warnings enabled. It also creates a task for the Travis CI builds that runs with warnings enabled.
Rouge currently disables Rubocop's AmbiguousRegexpLiteral cop and its Lint/AmbiguousOperator. Presumably this was because of the large number of regular expressions used in Rouge that are defined using the `/.../` literal syntax. This commit prepends all regular expressions of that form with `%r`. It also tidies up a few uses of the `*%w()` construct that are present in the codebase. This allows these warnings to be turned on without causing any issues. It should be noted that having the warnings disabled is not a problem in and of itself. However, these constructs also raise warnings when running Ruby with the `-w` switch. Getting Rouge to a point where it can be run with the `-w` switch will allow for a safer development environment.
@pyrmont I see that you occasionally use |
@ashmaroli Oh, that sounds handy. So you're saying in future that I would do the following?
And that's it? |
Actually no. The steps are: # checkout PR branch
git checkout feature/branch
# Pull in changes from upstream's 'master' branch.
# Resolve any merge conflicts along the way.
# Note: This creates a merge commit if there are unmerged commits in the PR branch.
git pull upstream master
# push current snapshot of PR branch to remote
git push origin feature/branch |
@ashmaroli Thank you—good to know! :) |
Rouge currently disables Rubocop's AmbiguousRegexpLiteral cop and its Lint/AmbiguousOperator. Presumably this was because of the large number of regular expressions used in Rouge that are defined using the
/.../
literal syntax.This commit prepends all regular expressions of that form with
%r
. It also tidies up a few uses of the*%w()
construct that are present in the codebase. This allows these warnings to be turned on without causing any issues.It should be noted that having the warnings disabled is not a problem in and of itself. However, these constructs also raise warnings when running Ruby with the
-w
switch. Getting Rouge to a point where it can be run with the-w
switch will allow for a safer development environment.