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

Use braces in tryCatch() calls #1839

Merged
merged 10 commits into from
Dec 18, 2022
Merged

Use braces in tryCatch() calls #1839

merged 10 commits into from
Dec 18, 2022

Conversation

IndrajeetPatil
Copy link
Collaborator

@IndrajeetPatil IndrajeetPatil commented Dec 12, 2022

Inspired by discussion in #1817.

@IndrajeetPatil IndrajeetPatil added the internals Issues related to inner workings of lintr, i.e., not user-visible label Dec 13, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2022

Codecov Report

Merging #1839 (6a55c30) into main (227a845) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1839   +/-   ##
=======================================
  Coverage   98.85%   98.85%           
=======================================
  Files         112      112           
  Lines        4814     4815    +1     
=======================================
+ Hits         4759     4760    +1     
  Misses         55       55           
Impacted Files Coverage Δ
R/get_source_expressions.R 93.94% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines 486 to 487
# This object should be named `e` because, if invalid characters are present,
# the error needs to be assigned in the parent frame, where it is named `e`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this reason, the content can't be assigned to parsed_content or some other, more informative name.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the parent's name given by the first argument to assign()?

so assign("e", parsed_content, ...) works?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, true that.

Sorry, I was doing search and replace, which changed both e and "e", and that's why it wasn't working.

I have made the necessary change now and the object is called parsed_content.

Thanks!

Copy link
Collaborator

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@MichaelChirico MichaelChirico merged commit 79efc11 into main Dec 18, 2022
@MichaelChirico MichaelChirico deleted the braced_try_catch branch December 18, 2022 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals Issues related to inner workings of lintr, i.e., not user-visible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants