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 IDR workflows #134

Closed
wants to merge 10 commits into from
Closed

Use IDR workflows #134

wants to merge 10 commits into from

Conversation

cicdguy
Copy link
Collaborator

@cicdguy cicdguy commented May 10, 2023

Instead of the custom ones.

@cicdguy cicdguy requested a review from danielinteractive May 10, 2023 11:02
@cicdguy cicdguy self-assigned this May 10, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 10, 2023

badge

Code Coverage Summary

Filename                       Stmts    Miss  Cover    Missing
---------------------------  -------  ------  -------  -----------------
R/DataJoint.R                      8       0  100.00%
R/DataLongitudinal.R              70       0  100.00%
R/DataSurvival.R                  78       0  100.00%
R/defaults.R                      11      11  0.00%    20-106
R/generics.R                       9       3  66.67%   40, 67, 136
R/JointModel.R                    46      21  54.35%   67-119, 129
R/Link.R                           6       0  100.00%
R/LinkNone.R                       3       1  66.67%   24
R/LongitudinalGSF.R               73      73  0.00%    32-163
R/LongitudinalModel.R             10       0  100.00%
R/LongitudinalRandomSlope.R       27       1  96.30%   27
R/Parameter.R                     12       1  91.67%   91
R/ParameterList.R                 28       3  89.29%   133-135
R/Prior.R                         33       5  84.85%   65-69
R/simulations.R                  177     177  0.00%    27-312
R/StanModel.R                      7       0  100.00%
R/StanModule.R                   119       5  95.80%   159-173, 205, 216
R/SurvivalExponential.R            9       9  0.00%    16-24
R/SurvivalLoglogistic.R           10      10  0.00%    18-27
R/SurvivalModel.R                 12       0  100.00%
R/SurvivalWeibullPH.R             10       0  100.00%
R/utilities.R                     64       1  98.44%   15
TOTAL                            822     321  60.95%

Results for commit: d7dbf27

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented May 10, 2023

Unit Tests Summary

  1 files  11 suites   14s ⏱️
15 tests 15 ✔️ 0 💤 0
49 runs  49 ✔️ 0 💤 0

Results for commit 5b0595d.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@danielinteractive danielinteractive left a comment

Choose a reason for hiding this comment

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

thx a lot Dinakar! much appreciated

@cicdguy
Copy link
Collaborator Author

cicdguy commented May 10, 2023

I'm just going to try to fix what I can and will merge after.

@danielinteractive
Copy link
Collaborator

Thanks @cicdguy , let me know once you are out of luck, then I can push more fixes on this branch, so that we avoid broken main

@gowerc
Copy link
Collaborator

gowerc commented May 13, 2023

Thank you for this, but did the code really need to be converted from 4 spaces to 2 ?

I know its all subjective but I personally find 2 spaces quite hard to visually read so had made it 4 spaces on purpose (though if I had free choice I would personally go for 3 spaces 😈 )

@danielinteractive
Copy link
Collaborator

Maybe we can just set a linter / styler option for 4 spaces indentation? If not, I would suggest to go with the standard = supported by the linter and styler packages

@gowerc
Copy link
Collaborator

gowerc commented May 19, 2023

I've not tested it but from a quick google search the following should apparently do it:

linters: linters_with_defaults(
    indentation_linter(indent = 4L)
)

@cicdguy
Copy link
Collaborator Author

cicdguy commented May 21, 2023

I've not tested it but from a quick google search the following should apparently do it:

linters: linters_with_defaults(
    indentation_linter(indent = 4L)
)

True for lintr, but won't work for styler. Unfortunately there aren't configuration files available for styler to define custom styles. Only arguments passed to the styler::style.* functions support custom styles currently.

Related discussion here: r-lib/styler#319

@danielinteractive
Copy link
Collaborator

@cicdguy
Copy link
Collaborator Author

cicdguy commented May 21, 2023

That would help from an editor setting standpoint. We can add the "4 vs 2" space setting as part of a custom workflow configuration instead. We'll just need to call out this style preference in the developer docs for this repo.

@danielinteractive
Copy link
Collaborator

@gowerc Can you make the call as Eng lead here regarding the trade off between better readability for you and maybe others vs higher maintenance effort? (custom workflow, editing settings, difference from other packages)

@gowerc
Copy link
Collaborator

gowerc commented May 24, 2023

I feel pretty strongly for using 4 spaces. Assuming I will re-inherit this when I come back it will annoy me much more having to code in 2 spaces from now on over having to add a configuration line into the workflow file :)

If you intend to put me on a different project then feel free to do whatever :)

@gowerc
Copy link
Collaborator

gowerc commented May 24, 2023

As an aside from here it is implied that the Styler repo is currently abandoned / seeking a new maintainer. Is this an issue for us at all ?

@danielinteractive
Copy link
Collaborator

Thanks @gowerc, ok then let's go for 4 spaces. @cicdguy

@danielinteractive
Copy link
Collaborator

@cicdguy Is my understanding correct that we basically just take the default style.yaml from the template but then modify line https://github.com/insightsengineering/r.pkg.template/blob/main/.github/workflows/style.yaml#L82 to say
styler::style_file(changed_r_files, style = tidyverse_style(indent_by = 4L), dry = dry)
?

@danielinteractive
Copy link
Collaborator

Or, alternatively, could you add a number parameter to your template workflow, that can then be modified in downstream repos? e.g. indent_by and then we can just have a yaml parameter changed to 4 (from original default 2)?

@danielinteractive
Copy link
Collaborator

@cicdguy I just tried to resolve the merge conflicts but that seems too complicated, I would suggest to close this PR and make a new one, including the indentation setting adaptation as discussed above

@cicdguy cicdguy closed this Jun 1, 2023
@cicdguy cicdguy deleted the use-idr-workflows branch June 1, 2023 10:59
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