lintRepo {PaRe}R Documentation

lintRepo

Description

Get all the lintr messages of the Repository object.

Usage

lintRepo(repo)

Arguments

repo

(Repository)

Value

(data.frame)

column data type description
filename character Name of the file
line_number double Line in which the message was found
column_number double Column in which the message was found
type character Type of message
message character Style, warning, or error message
line character Line of code in which the message was found
linter character Linter used

Examples

fetchedRepo <- tryCatch(
  {
    # Set dir to clone repository to.
    tempDir <- tempdir()
    pathToRepo <- file.path(tempDir, "glue")

    # Clone repo
    git2r::clone(
      url = "https://github.com/tidyverse/glue.git",
      local_path = pathToRepo
    )

    # Create instance of Repository object.
    repo <- PaRe::Repository$new(path = pathToRepo)

    # Set fetchedRepo to TRUE if all goes well.
    TRUE
  },
  error = function(e) {
    # Set fetchedRepo to FALSE if an error is encountered.
    FALSE
  },
  warning = function(w) {
    # Set fetchedRepo to FALSE if a warning is encountered.
    FALSE
  }
)

if (fetchedRepo) {
  # Run lintRepo on the Repository object.
  messages <- lintRepo(repo = repo)
}

[Package PaRe version 0.1.13 Index]