-
Notifications
You must be signed in to change notification settings - Fork 2
Description
One idea for a hook that does other things than adding default shiny UI/server could be for convenient project setup in a vscode environment.
I use vscode and whenever I start a golem project with golem::create_golem() I'd like to add the default .vscode, a linter (because the "Error Lens" extension can become quite anoying) and apply a style guide.
One could add convenient ghook::-helper funcs that provide this behaviour. The ghook::-helper funcs would essentially do the following:
- create directory
.vscodecontaining a file.vscode/PROJECT_NAME.code-workspace:This is the default.{ "folders": [ { "path": ".." } ], "settings": {} } - add a styler hook:
options(languageserver.formatting_style = function(options) {
grkstyle::grk_style_transformer()
# styler::tidyverse_style(indent_by = options$tabSize)
})
styler::style_pkg() - create a linter file:
lintr::use_lintr(type = "tidyverse")with extensions passing additional lintr settings https://lintr.r-lib.org/reference/linters_with_defaults.html or copy pasting a lintr template file or somehting like that.
A user defined ghook-hook could then make use of these helper functions that have additional parameters for further customization (e.g. at the styler part I'd add the possibility to use the grk or tidyverse styler, and at the linter part I'd add the possibility to set some default linters via ... or something like that).
Would that be something useful?