respect lintr no lint comment position
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 446
- Forks
- 32
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 1
Description
Not sure if this is intentional, but when I have a # nolint comment at the function definition it gets shifted a line below and effectively removing the no lint command for that line:
before formatting:
as_task_fcst.TaskFcst = function(x, clone = FALSE, ...) { # nolint
if (clone) x$clone() else x
}
after formatting:
as_task_fcst.TaskFcst = function(x, clone = FALSE, ...) {
# nolint
if (clone) x$clone() else x
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the formatting example in the issue and trace how the formatter handles an inline # nolint comment on a function definition. Done means formatting preserves the comment's association with the function line so lintr still ignores the intended line, with coverage for this before-and-after case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100