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

Issue https://github.com/ATFutures/calendar/issues/57 fix 🔧 #58

Merged
merged 4 commits into from
Aug 10, 2024
Merged

Conversation

serkor1
Copy link
Contributor

@serkor1 serkor1 commented Aug 9, 2024

Hi,

I have created a new R-script called utils, which contains the assert()-function. For some devs this is the standard file to put these kind of helper-functions in - this is at least what I do 😄

Note

I have only added the functionality to functions that already used a mix of stopifnot and stop. I haven't added this functionality on any other functions.

I found two typos that I have corrected also. See commit e63371e and 24c1211.

The dependency on {methods} are gone, and a new dependency on {cli} is made. The {methods}-package were only used in two functions. So I believe this was a good choice.

I have run devtools::check() and everything passes locally.

Best,

@serkor1

serkor1 added 4 commits August 9, 2024 12:14
* Added person-object to description; Serkan Korkmaz

* Fixed typo: iCalender to iCalendar
See issue #57. The function is a high-level stopifnot()- and tryCatch()-function wrapper built on {cli}-package.
* The function now uses the assert()-function instead of the stopifnot()-function

* The function now uses inherits() instead of methods::is()
* ical()-function update:

	* The function now asserts passed arguments instead of storing the class.
	* All stop-controls have been replaced with assert.
	* Removed redundant assignment of column names to `n`. It is now directly passed into the control-flow.

* description update:

	* methods have now been deleted from imports. Only a few functions were using it.
	* cli have been added to the import section
	* another typo in the title and description have been fixed. Was "iCalander" and now is "iCalendar"
@Robinlovelace
Copy link
Member

Great stuff, will take a look!

Copy link
Member

@Robinlovelace Robinlovelace left a comment

Choose a reason for hiding this comment

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

Looks good to me. Any extra comments @layik, @mpadge or anyone else before merging? See comments from me @serkor1. Good work 🚀.

DESCRIPTION Show resolved Hide resolved
DESCRIPTION Show resolved Hide resolved

return(x)

}

stopifnot(methods::is(object = x, class2 = "character") | methods::is(object = x, class2 = "list"))
assert(
inherits(x = x, what = "character") | inherits(x = x, what = "list"),
Copy link
Member

Choose a reason for hiding this comment

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

👍

BEGIN = "VCALENDAR",
PRODID = "ATFutures/calendar",
VERSION = "2.0",
BEGIN = "VCALENDAR",
Copy link
Member

Choose a reason for hiding this comment

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

Why this extra whitespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if it's redundant. But I thought it "looked better" honestly. I changed it from,

a = 2
aa = 2
aaa = 2

to

a   = 2
aa  = 2
aaa = 2

@layik
Copy link
Member

layik commented Aug 9, 2024

Looks good to me. Any extra comments @layik, @mpadge or anyone else before merging? See comments from me @serkor1. Good work 🚀.

I am away so quick reply from me to say if it passes the tests (coverage of which I just checked is now deactivated on CodeCov) it is good enough for me. Thanks @serkor1 for the contribution.

@Robinlovelace Robinlovelace merged commit 8480329 into ATFutures:master Aug 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants