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

Remove {styler} dependency #1919

Closed
lorenzwalthert opened this issue May 24, 2023 · 6 comments · Fixed by #1942
Closed

Remove {styler} dependency #1919

lorenzwalthert opened this issue May 24, 2023 · 6 comments · Fixed by #1942
Assignees

Comments

@lorenzwalthert
Copy link

lorenzwalthert commented May 24, 2023

Hi, author of the formatting package {styler} here. As I judge from a search in your source code, there is no functionality that uses {styler}, in other words {styler} is not a runtime dependency. You recommend people to format their code when they contribute, so {styler} is a development dependency. Adding {styler} as a dependency to your package has the following drawbacks:

  • Your user's may install a package they don't need (assuming most people who install your package are useres, not developers). This costs additional bandwith, installation time, disk space etc... If they need it, they can just manually install it.
  • I as a maintainer of {styler} have to run reverse dependency checks (R CMD Check your package with my new version of {styler}) upon submitting to CRAN e.g. with {revdepcheck}. {styler} has more than 40 reverse dependencies, which makes this a long process.

For that reason, I suggest you to drop that dependency from your package. If you want to ensure your code remains styled, I recommend {precommit} to apply {styler} on each commit or other tools described in the third-party integrations website of {styler}.

For the removal to take effect, a CRAN submission of your package is required. For tracking, this issue is referenced in r-lib/styler#1121.

@bms63
Copy link
Collaborator

bms63 commented May 24, 2023

HI @lorenzwalthert so we have an automated renv.lock generation that is housed here: https://github.com/pharmaverse/admiralci/blob/main/.github/workflows/r-renv-lock.yml

Unfortunately, it pulls the styler package out of the Description File to help generate the renv.lock file. This way developers can easily install all necessary packages to do development work.

I don't think we can remove the package right now, but we will continue to discuss if there is a better solution so we don't have so many dependencies like styler and cause you headaches when doing a release!

@galachad @cicdguy what do you think?

@lorenzwalthert
Copy link
Author

ok, thanks for the explanation. I agree that in conjunction with {renv}, it's a special case. FWIW with renv::record(), you can manually record a dependency into renv.lock that is not in DESCRIPTION, but then if people use {renv} APIs to update renv.lock e.g. with renv::snapshot() (if they ever), they might be confused about the diff they see, as styler would then be removed from renv.lock.

@galachad
Copy link
Member

galachad commented Jun 2, 2023

Hi @lorenzwalthert thank you for the suggestion. I think we can remove it from the DESCRIPTION and keep the {styler} only in renv.lock for developers.

The {styler} is only in Suggests section of DESCRIPTION. Is it still impacting your reverse dependency {revdepcheck} process?

@galachad galachad moved this from Backlog to Priority in admiral (sdtm/adam, dev, ci, template, core) Jun 2, 2023
@galachad galachad self-assigned this Jun 2, 2023
@lorenzwalthert
Copy link
Author

Ok, cool. Yes, Suggests: are also checked. Thanks.

@bms63 bms63 moved this from Priority to In Review in admiral (sdtm/adam, dev, ci, template, core) Jun 5, 2023
galachad added a commit to pharmaverse/admiraltemplate that referenced this issue Jun 5, 2023
@bms63 bms63 linked a pull request Jun 6, 2023 that will close this issue
14 tasks
@galachad
Copy link
Member

galachad commented Jun 6, 2023

  • admiraldev
  • admiral
  • admiraltemplate
  • admiralvaccine
  • admiraloptha
  • admiralonco
  • admiral.test

Should be removed from all repositories.

@lorenzwalthert
Copy link
Author

lorenzwalthert commented Jun 7, 2023

Thanks for acting so timely. Hope you can enjoy the latest {styler} release with significant speed gain 😄

cicdguy added a commit to pharmaverse/admiraltemplate that referenced this issue Jun 7, 2023
Co-authored-by: cicdguy <26552821+cicdguy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants