Get all the lintr messages of the Repository object.

lintRepo(repo)

Arguments

repo

(Repository)

Value

(data.frame)

columndata typedescription
filenamecharacterName of the file
line_numberdoubleLine in which the message was found
column_numberdoubleColumn in which the message was found
typecharacterType of message
messagecharacterStyle, warning, or error message
linecharacterLine of code in which the message was found
lintercharacterLinter 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
  }
)
#> cloning into 'C:\Users\MVANKE~1\AppData\Local\Temp\RtmpwNkTBX/glue'...

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