-
Notifications
You must be signed in to change notification settings - Fork 15
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
build: Add a GHA Linter #79
Conversation
6c3bd27
to
8a72a0c
Compare
@@ -4,3 +4,5 @@ | |||
.git | |||
.github | |||
misc | |||
^\.github$ | |||
.lintr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lintr
is the R linting library and the file .lintr
is its configuration.
@@ -0,0 +1,32 @@ | |||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is autogenerated by using the tool usethis::use_github_action("lint-project")
linters: linters_with_defaults( | ||
line_length_linter(120), | ||
commented_code_linter = NULL, | ||
object_usage_linter = NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This last one is useful, but there is a bug in the way lintr works where it views internal functions and references to them as undeclared globals. I have too many internal functions to ignore each line, so disabling this for now. We could circumvent this by installing the package before linting, but that would requiring installing seurat and hdf5r which takes forever to install.
See here for more information
executable_path = NULL, | ||
force = FALSE | ||
) { | ||
h5path, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code was auto formatted with styler
cmd_msg <- sprintf('running command: "%s"', paste(c(executable_path, args), collapse=" ")) | ||
logMsg(cmd_msg) | ||
cmd_msg <- sprintf('running command: "%s"', paste(c(executable_path, args), collapse = " ")) | ||
log_msg(cmd_msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the name to log_msg
to satisfy the linter.
|
||
#' validation error with link to 10x support | ||
#' @noRd | ||
validation_err <- function(msg, name) { | ||
sprintf("\nIt looks like the formatting of your %s does not match the required formatting for LoupeR. For further information, please see the documentation: 10xgen.com/louper\n\n%s", name, msg) | ||
sprintf( | ||
paste( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use paste
to fix lines that are too long
Used
styler
to auto format the code. Usedlintr
to catch linting errors. No code change should follow.Fixes #77