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

Service endpoint #685

Merged
merged 5 commits into from
Oct 5, 2023
Merged

Service endpoint #685

merged 5 commits into from
Oct 5, 2023

Conversation

DyfanJones
Copy link
Member

Remove comments before for loop. Addresses issue highlighted in #667


# Get the profile name from an ini file
found <- grep("^\\[.*\\]", content)
rm_els <- grep("(^;)|(^#)", content)
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to allow for indented comments, see this beauty of a config file in the wild.

Suggested change
rm_els <- grep("(^;)|(^#)", content)
rm_els <- grep("(^;)|(^\\s+#)", content)

Copy link
Member Author

Choose a reason for hiding this comment

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

I will add it to the test data_ini to make sure it removes them correctly :)

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (93f6f46) 84.11% compared to head (33268f5) 84.14%.
Report is 3 commits behind head on main.

❗ Current head 33268f5 differs from pull request most recent head ee11603. Consider uploading reports for the commit ee11603 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #685      +/-   ##
==========================================
+ Coverage   84.11%   84.14%   +0.02%     
==========================================
  Files         201      201              
  Lines       14437    14515      +78     
==========================================
+ Hits        12144    12213      +69     
- Misses       2293     2302       +9     

see 12 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DyfanJones
Copy link
Member Author

DyfanJones commented Oct 5, 2023

I believe the new test ini file should cater for most scenarios https://github.com/paws-r/paws/blob/7c10b6bfeb99e30974748c36ded79ddc9967ba2b/paws.common/tests/testthat/data_ini

When I looked into the package ini it didn't handle nested content at all and it could falter on some comments (specially if it had space infront).

On the bright side the new read_ini seems to run better than the old method and the ini package (reading in the test data_ini file).
image

@DyfanJones DyfanJones merged commit 213be0a into paws-r:main Oct 5, 2023
5 checks passed
@DyfanJones DyfanJones added the enhancement 💡 New feature or request label Oct 16, 2023
@DyfanJones DyfanJones deleted the service_endpoint branch November 13, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants