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
[Fix #7777, #7776]: Generate valid code if comment present before closing brace #7835
Closed
shekhar-patil
wants to merge
14
commits into
rubocop:master
from
shekhar-patil:Fix-7777-7776-generate-valid-code-if-comment-present-before-closing-brace
Closed
[Fix #7777, #7776]: Generate valid code if comment present before closing brace #7835
shekhar-patil
wants to merge
14
commits into
rubocop:master
from
shekhar-patil:Fix-7777-7776-generate-valid-code-if-comment-present-before-closing-brace
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tejasbubane
reviewed
Apr 1, 2020
tejasbubane
reviewed
Apr 1, 2020
Add changes in change log file
Fix typo in CHANGELOG
…rective implement Style/DisableCopsWithinSourceCodeDirective cop
Resolve part of #7842. This PR fixes a false positive for `Lint/RaiseException` when raising Exception with explicit namespace. `Exception` belonging to a namespace is expected to inherit `StandardError`. This PR makes `Lint/RaiseException` aware of the following differences: ```ruby Gem::Exception.new.is_a?(StandardError) # => true Exception.new.is_a?(StandardError) # => false ``` On the other hand, the following case have not been resolved by this PR. ```ruby module Gem def self.foo raise Exception end end Gem.foo #=> Gem::Exception ``` The above case will be resolved separately from this PR.
…exception [#7842] Fix a false positive for `Lint/RaiseException`
Fix `Lint/UriRegexp` to register offense with array arguments
Fixes #7841. This PR fixes an error for `Style/TrailingCommaInBlockArgs` cop when lambda literal (`->`) has multiple arguments. It will not be checked in the case of lambda literal because lambda literal (`->`) never have a block arguments. ```console # Valid syntax % ruby -ce '-> (foo, bar) { do_something(foo, bar) }' Syntax OK # Syntax error % ruby -ce '-> { |foo| do_something }' -e:1: syntax error, unexpected '|' -> { |foo| do_something } ^ # Also syntax error % ruby -ce '-> (foo, bar,) { do_something(foo, bar) }' -e:1: syntax error, unexpected ')' -> (foo, bar,) { do_something(foo, bar) } ^ -e:1: syntax error, unexpected '}', expecting end-of-input r,) { do_something(foo, bar) } ^ ```
…_in_block_args [Fix #7841] Fix an error for `Style/TrailingCommaInBlockArgs` cop
…returning method
shekhar-patil
deleted the
Fix-7777-7776-generate-valid-code-if-comment-present-before-closing-brace
branch
April 7, 2020 07:29
shekhar-patil
changed the title
[Fix #7777, #7776]: Generate valid code if comment present before closing-brace
[Fix #7777, #7776]: Generate valid code if comment present before closing brace
Apr 7, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #7777 #7776
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and RuboCop for itself, and generates the documentation.