Skip to content

Apply Jarl fixes - #150

Open
khammami wants to merge 3 commits into
FRBCesab:mainfrom
khammami:jarl-fix
Open

Apply Jarl fixes#150
khammami wants to merge 3 commits into
FRBCesab:mainfrom
khammami:jarl-fix

Conversation

@khammami

@khammami khammami commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

this PR fixes #149

Most fixes were applied by jarl (default rules)

jarl check . --fix

Summary (GH Copilot)

Code simplification and consistency:

  • Replaces x[!(x == "")] with the simpler and more idiomatic x[x != ""] for removing empty strings in multiple R scripts, including add_badge.R, add_renv.R, add_vignette.R, get_all_dependencies.R, get_minimal_r_version.R, and utility functions in utils-deps.R. [1] [2] [3] [4] [5] [6] [7] [8]

Test refactoring and clarity:

  • Refactors tests to separate assignment and assertion steps, e.g., splitting expect_null(x <- foo()) into x <- foo(); expect_null(x), and similarly for other assertions. This affects many test files, improving readability and debuggability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24]

  • Updates test logic to use !any(grepl(...)) instead of all(!grepl(...)) for improved clarity and intent in pattern matching assertions. [1] [2]

Utility function improvements:

  • Improves argument validation in resolve_project_meta by using anyNA() instead of any(is.na(...)) and by replacing any(!(x %in% y)) with !all(x %in% y), making the logic more idiomatic and robust.

These changes do not affect the core logic or output of the functions but improve code readability, maintainability, and test clarity.

@khammami
khammami requested a review from ahasverus as a code owner June 4, 2026 12:48
@khammami khammami changed the title Apply Jarl fixes Apply Jarl fixes Jun 4, 2026
@khammami
khammami marked this pull request as draft June 5, 2026 15:29
@khammami

khammami commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Please run jarl check . on the main branch to check all lint warnings.

I refactored some assignments in tests as expect_silent() return the first argument

@khammami
khammami marked this pull request as ready for review June 8, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Apply jarl on rcompendium

1 participant