Repository navigation
Add ggplot_args_linter: pipe data into ggplot(), aes() as its own layer - #89
Conversation
Part of the no-nested-calls policy (nested_calls = TRUE). nested_call_linter allows aes() as an argument, so ggplot(df, aes(x, y)) passed lint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9nm2UYhuLY1k6irzLP
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019xfc9nm2UYhuLY1k6irzLP
|
Claude finished review — View run Review: Add
|
2026-11-03 18:57 UTC |
Requested by Ezra · project thread
Ezra's rule (2026-11-03): never nest
aes()insideggplot(), and pipe the primary data into a bareggplot()rather than passing it as an argument. Form:df |> ggplot() + aes(x, y) + geom_line()(message).nested_call_linter()allowsaes()as an argument, soggplot(df, aes(x, y))passed lint. This addsggplot_args_linter(), a warning on any argument ofggplot(): anaes()call gets the "don't nest aes()" message, and any other argument (ggplot(df),ggplot(data = df)) gets the "pipe the data" message. Positional, named andggplot2::forms are covered.aes()inside a layer such asgeom_point(aes(colour = g))is not flagged. It is included indefault_linters(nested_calls = TRUE), solint-changed-linesenforces it on changed lines once a repo'slms-refmoves to the merged commit. No existing code is swept.Tests: 17 expectations in
test-ggplot_args_linter.R(flagged forms, the data argument, both lints on one call, unflagged forms, inclusion in the default set), and the full lms suite passes. Not run: R CMD check.The lds chunk that prompted this is fixed in lds#1752.
Annotations read on head f5471d9: all 16 check runs carry only
noticeannotations, none from this diff. They are the runner-images notice that theubuntu-latestlabel migrates to Ubuntu 26, an emptySUBMODULES_TOKEN(submodules clone anonymously), and the preview's diff highlighting cap on a page with more than 500 elements. This change touches onlylms/.Cross-harness review waived: the agy and OpenCode Go quotas are exhausted and Codex is not used (standing waiver, adversarial-self-review.md). Merged on Ezra's mwc.
https://claude.ai/code/session_019xfc9nm2UYhuLY1k6irzLP
Generated by Claude Code