Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings from cyclocomp_linter #654

Closed
MichaelChirico opened this issue Dec 2, 2020 · 1 comment · Fixed by #674
Closed

Warnings from cyclocomp_linter #654

MichaelChirico opened this issue Dec 2, 2020 · 1 comment · Fixed by #674

Comments

@MichaelChirico
Copy link
Collaborator

As part of #653, I ran lintr::lint_package():

lintr::lint_package()

A ton of warnings were thrown:

#Warning messages:
#1: In parent == parent[before_operator_idx] :
#   longer object length is not a multiple of shorter object length
# ...
#653 50: In parent == parent[before_operator_idx] :
#  longer object length is not a multiple of shorter object length

At a glance, I suspect that cyclocomp_linter is getting tripped up by the with() expression:

with(
  source_file$parsed_content,
  token == "expr" & parent == parent[before_operator_idx]
)

But needs more investigation

@AshesITR
Copy link
Collaborator

AshesITR commented Dec 4, 2020

Apparently before_operator_idx can have more than one TRUE entry.
At first glance, == should be %in% to fix the warnings.

AshesITR added a commit that referenced this issue Dec 4, 2020
* Fix object length warnings in spaces_left_parentheses_linter

fixes #654

* add regression test and NEWS entry

* fix trailing newline

* explain why we use complexity.R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants