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

build: Add a GHA Linter #79

Merged
merged 8 commits into from
Jan 9, 2025
Merged

build: Add a GHA Linter #79

merged 8 commits into from
Jan 9, 2025

Conversation

esiegel
Copy link
Collaborator

@esiegel esiegel commented Jan 6, 2025

Used styler to auto format the code. Used lintr to catch linting errors. No code change should follow.

Fixes #77

@esiegel esiegel force-pushed the esiegel/add_linter branch from 6c3bd27 to 8a72a0c Compare January 8, 2025 04:30
@@ -4,3 +4,5 @@
.git
.github
misc
^\.github$
.lintr
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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,
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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

@esiegel esiegel requested a review from gmjoseph January 8, 2025 04:56
@esiegel esiegel merged commit bd9c6f6 into main Jan 9, 2025
4 checks passed
@esiegel esiegel deleted the esiegel/add_linter branch January 9, 2025 06:02
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.

Add GHA to check for linting issues
2 participants