-
Notifications
You must be signed in to change notification settings - Fork 132
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
Fix 887 and improve code coverage of R/config.R
from 28.21% to 100%
#1043
Commits on May 27, 2023
-
fix: add user supplied path to config for guess_where_config()
- add helper try_user_config_location() - search for new config location to be set inside R/app_config.R - update guess_where_config() with a final guess using this helper - run styler::style_file("R/config.R", transformers = grkstyle::grk_style_transformers())
Configuration menu - View commit details
-
Copy full SHA for 31213b0 - Browse repository at this point
Copy the full SHA 31213b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83a96a7 - Browse repository at this point
Copy the full SHA 83a96a7View commit details
Commits on Jun 5, 2023
-
test: guess_where_config() works with path changes
- path changes mean new dir and new filename so: - create a new dir for config - move config to that dir and rename => test correctly identifies changes (changing dir AND changing filename) in the yaml-config. attribute to @ALanguillaume with some minor tweaks Co-authored-by: ALanguillaume <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 230b73d - Browse repository at this point
Copy the full SHA 230b73dView commit details
Commits on Aug 3, 2023
-
refactor: improve readability and logical of `try_user_config_locatio…
…n()` - encapsulate finding the relevant lines in the config file into "guess_lines_to_config_file()" - function allows for multi-line/grk-style app_sys()-calls (if file path to long and must be put into next line) - has clearer and commented logic to find the lines - document proper logic of function with comments - style with `grkstyle::grk_style_transformer` - update `tests/testthat/test-config.R` to incorporate above changes and move code coverage of that file to 63.16%
Configuration menu - View commit details
-
Copy full SHA for 8e98808 - Browse repository at this point
Copy the full SHA 8e98808View commit details -
style: try_user_config_location() returns fs-paths for consistency
- allows valid comparison with fs_path()'s inside guess_where_config() and output values from try_user_config_location() - fix a typo in a comment
Configuration menu - View commit details
-
Copy full SHA for 90ee1ca - Browse repository at this point
Copy the full SHA 90ee1caView commit details -
refactor: improve readability and logic inside guess_where_config
Why: - clearly outline the different cases: since now the user can add a golem-config, there can be conflicting cases between the default golem config and the user golem config (if e.g. the user forgets to delete the default) - update the tests to check these different cases - remark: test inside testthat should work without golem:: prefixes
Configuration menu - View commit details
-
Copy full SHA for a941ec1 - Browse repository at this point
Copy the full SHA a941ec1View commit details -
test: add test for exotic corner cases of guess_where_config()
- test that config file can be found if - we end up inside "inst/" (a corner case not tested before) - guess_where_config() is fed with argument values for 'path' and 'file' that do not work -> improves code coverage to 70.75%
Configuration menu - View commit details
-
Copy full SHA for 095bfc5 - Browse repository at this point
Copy the full SHA 095bfc5View commit details -
feature: guess_where_config() fails a bit faster
- remove last if-statement (which is almost a duplicate of the one before) -> this makes the guess_where_config() fail easier (i.e. return NULL) as other exotic corner cases should be handled more explicitly - remark: golem::pkg_path() will (almost) never produce an error but this may change so the try-construct within attempt() is kept - improve comments for corner case IV.B as internal developer note
Configuration menu - View commit details
-
Copy full SHA for 3917328 - Browse repository at this point
Copy the full SHA 3917328View commit details -
Configuration menu - View commit details
-
Copy full SHA for f3e6cb2 - Browse repository at this point
Copy the full SHA f3e6cb2View commit details -
test: move coverage of R/config.R to 100%
- notably: add package mockery to Suggests (no dependencies except for testthat and used for tests only) - add tests for non-interactive usage of guess_where_config(): check that error is thrown correctly - add tests for interactive usage of guess_where_config(): - user says yes: test that necessary files are created - user says no: test that we return NULL - add tests for encapsulated ask_golem_creation_upon_config() - shallow test as non-interactive menu() calls (inside the yesno()) are forbidden - but this makes code coverage 100% :)
Configuration menu - View commit details
-
Copy full SHA for caf682a - Browse repository at this point
Copy the full SHA caf682aView commit details -
docs: update docs for get_current_config()
- only exported function from R/config.R needs proper docs - besides more details on older usage and behavior: - add docs on how to set user supplied golem config - add code snippets
Configuration menu - View commit details
-
Copy full SHA for 6529474 - Browse repository at this point
Copy the full SHA 6529474View commit details