Skip to content

Hit 99% code coverage #738

@MichaelChirico

Description

@MichaelChirico

As of this writing we're at 97.09%:

https://codecov.io/gh/jimhester/lintr/tree/master/R

99% would be 2450 of 2475 expressions on current HEAD, an increase of 47 lines covered.

Alternatively we can mark about the same number of lines as # nocov to get there.

I think that's a good ambitious target to hit for release, but don't let this issue be too much of a blocker.


quoting from #739

Going through the files with coverage < 100%:

  • namespace.R is covered by fix and test namespace_imports() in object_name_linter #740, so we can leave it alone
  • namespace_linter.R has an uncovered lint that should trigger only if a package is installed, but loading its namespace fails. IDK how we would test that at all. I'd be fine with # nocov'ing ll 93--104
  • cache.R has gaps where we check for specified paths to not mess up loading settings.
  • We could add a test that self-lints lintr with caching enabled, I think. WDYT?
  • make_linter_from_regex.R could need a test with a custom linter created on-the-fly. The uncovered parts are the builder code.
  • get_source_expressions.R has a few blind spots. The first one is for parser errors without location information. We manually try to find location information for the attempt to use zero-length variable name case. Other cases aren't tested and I don't even know about them. I'd be fine with # nocov'ing ll 101 -- 109 since those are a fallback Lint if we missed a parse error without location information.
  • The next is in fix_column_numbers() and should be tested.
  • Finally fix_eq_assigns() has a blind spot I think could be reached if there are multiple eq-assignments to be fixed.
  • tree-utils.R has no tests for simplify = FALSE in children() and parents().
  • path_linters.R has in a few holes in split_path()
  • object_usage_linter.R seems to have an unreachable early return (IMO we should check full_xml_parsed_content for consistency across all file-level XPath-based linters. IINM coverage will increase if it's added to the test for fix and test namespace_imports() in object_name_linter #740.
  • comments.R the travis_build_info() seems bugged because "" %||% NULL will always be "", so travis_build_info() will never return NULL, even if !in_travis().
  • backport_linter.R has a blind spot when a backport lint spans multiple lines.
  • seq_linter.R: I'm unsure how to reach the uncovered line 29. IINM, the XPath expression guarantees existence of the children. Maybe 1:1 triggers it?
  • settings.R has a miss because ~/.lintr doesn't exist. I think we can safely # nocov l 97.
  • comment_linters.R has a miss in parsable(). I don't think this is reachable, seems okay to remove it.
  • lint.R has a miss for lint(cache = TRUE) and checkstyle_output() if attr(lints, "path") exists. I didn't even know about the attribute. Is this still relevant or should we remove it?
  • expect_lint.R has no failure test case for expect_lint_free().
  • utils.R has no test for xml_nodes_to_lint() where the lint spans multiple lines.
  • methods.R has no test for rstudio_source_markers() if there are no lints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    internalsIssues related to inner workings of lintr, i.e., not user-visible

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions