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

Add lintr config #167

Merged
merged 4 commits into from
Apr 3, 2021
Merged

Add lintr config #167

merged 4 commits into from
Apr 3, 2021

Conversation

JanMarvin
Copy link
Collaborator

Currently there are hundreds of notifications that lintr throws. There are many cases where lintr follows the tidyverse style by default, while we use a somewhat wild mix of whatever the authors liked. Fixing many of these style-related clues is a tedious task (that no one is going to tackle anytime soon, and - on a personal note - some of the default style ideas are at least debatable), but currently there is no longer any benefit from static code analysis if the output is buried in a bunch of stuff that no one cares about. So I disabled all the non-critical linters to just show the warnings for now.

Some of the other stuff should be fixed as well, but until someone has the time to fix those, I think it's best to just not output them at all.

@JanMarvin
Copy link
Collaborator Author

God damnit. Guess now I have to fix all the broken exports/importsfrom 😞

@JanMarvin
Copy link
Collaborator Author

JanMarvin commented Apr 2, 2021

That's much better. The remaining warnings are actual warnings we could/should work on. Either by adding #nolint or better by fixing them.

Currently the following is reported:

Warning: local variablenassigned but may not be used
Warning messages:
1: In readLines(filename) :
  incomplete final line found on '/Users/runner/work/openxlsx/openxlsx/tests/testthat/test-loading_workbook.R'
2: In readLines(filename) :
  incomplete final line found on '/Users/runner/work/openxlsx/openxlsx/tests/testthat/test-named_regions.R'
3: In readLines(file) :
  incomplete final line found on '/Users/runner/work/openxlsx/openxlsx/tests/testthat/test-named_regions.R'
4: In readLines(filename) :
  incomplete final line found on '/Users/runner/work/openxlsx/openxlsx/tests/testthat/test-outlines.R'
5: In readLines(filename) :
  incomplete final line found on '/Users/runner/work/openxlsx/openxlsx/tests/testthat/test-saveWorkbook.R'
6: In readLines(filename) :
  incomplete final line found on '/Users/runner/work/openxlsx/openxlsx/tests/testthat/test-write_xlsx_vector_args.R'
Warning: local variablecountassigned but may not be used
Warning: local variablesheetWithPivotassigned but may not be used
Warning: no visible global function definition forshellWarning: local variablenvarsassigned but may not be used
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: local variabledateIdsassigned but may not be used
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid length(...):1 expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid length(...):1 expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: local variablebgFillListassigned but may not be used
Warning: local variablefgFillListassigned but may not be used
Warning: local variablexmlassigned but may not be used
Warning: local variablesheetassigned but may not be used
Warning: local variablesheetassigned but may not be used
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:ncol(...) expressions, use seq_len.
Warning: Avoid 1:ncol(...) expressions, use seq_len.
Warning: Avoid 1:nrow(...) expressions, use seq_len.
Warning: Avoid 1:nrow(...) expressions, use seq_len.
Warning: Avoid 1:ncol(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.
Warning: Avoid 1:length(...) expressions, use seq_len.

@ycphs ycphs merged commit b253027 into ycphs:master Apr 3, 2021
@ycphs
Copy link
Owner

ycphs commented Apr 4, 2021

I cleaned up the code with PR #168

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 this pull request may close these issues.

2 participants