Skip to content

Address lintr findings (259 issues) #2

@NewGraphEnvironment

Description

@NewGraphEnvironment

Problem

lintr::lint_package() reports 259 issues across the codebase after migration.

Summary by Linter

# Done Linter Count Type
1 [ ] line_length_linter 178 style - lines > 80 chars
2 [ ] commented_code_linter 18 style - commented-out code
3 [ ] object_usage_linter 16 potential bugs
4 [ ] quotes_linter 10 style - quote consistency
5 [ ] object_name_linter 8 style - naming conventions
6 [ ] trailing_blank_lines_linter 8 style - extra blank lines
7 [ ] indentation_linter 7 style - inconsistent indent
8 [ ] return_linter 5 style - explicit returns
9 [ ] brace_linter 3 style - brace placement
10 [ ] commas_linter 2 style - spacing after commas
11 [ ] paren_body_linter 2 style - space after parens
12 [ ] semicolon_linter 2 style - trailing semicolons

object_usage_linter Details (#3 - Priority)

These 16 issues flag potential bugs or missing declarations:

NSE (Non-Standard Evaluation) false positives:

  • spk_join.R:59,61 - .data pronoun (dplyr NSE)
  • spk_join.R:86 - across, all_of (dplyr verbs)
  • spk_layer_info.R:32,47 - name, driver columns
  • spk_q_layer_info.R:67-68 - layer_name, time_exported, name
  • spk_rast_rm_empty.R:30 - spk_rast_not_empty function reference

Unused local variables:

  • spk_join.R:96 - changed_details assigned but not used
  • spk_q_layer_info.R:51 - nodes assigned but not used
  • spk_stac_calc.R:201 - id assigned but not used
  • spk_stac_calc.R:240,250,258 - t0, t1, t2 timing vars

Proposed Solution

  1. Configure .lintr to set line length to 120 chars (CLAUDE.md specifies 120)
  2. Add globalVariables() for NSE column names (already partially done in utils.R)
  3. Review unused variables - some are legitimate (timing vars used conditionally), others can be removed
  4. Incrementally fix style issues in future commits

Configuration

Create .lintr file:

linters: linters_with_defaults(
  line_length_linter(120)
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions