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
Streamline and tighten lintr checks #220
Conversation
General question to correct my own ignorance: is there a way for me to run this check locally? As in, before committing/pushing, a one-line-at-prompt, use this configuration to lint? |
Very interesting question @pearsonca! I've never really considered it. I usually just run |
Not one line but the code from the GHA can be modified to work locally on changed files, before you changed_files <- gert::git_diff()$new
all_files <- list.files(recursive = TRUE)
exclusions_list <- as.list(setdiff(all_files, changed_files))
lintr::lint_package(exclusions = exclusions_list) |
Codecov Report
@@ Coverage Diff @@
## develop #220 +/- ##
========================================
Coverage 97.30% 97.31%
========================================
Files 14 14
Lines 1524 1527 +3
========================================
+ Hits 1483 1486 +3
Misses 41 41
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I again forgot to base my changes on |
1ce74ee
to
c36a250
Compare
You are a 🦸🏻♂️! Just going through commit by commit.
This is super easy to do. Any thoughts on ways we can make our
This is really showing the value of these additional linters! I think that the right variables are being passed (on line 667) to the underlying function as expected and that this was just an oversight (which I would hope tests would catch if causing issues). This is quite important functionality though so I think perhaps we should not change this in this PR and deal with in a separate issue just to make doubly sure that everything is working as expected.
Pretty excited about this!
@pearsonca I think |
re basing off |
I have ineffectually looked for this a few times as it seems like there must be. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me and is a lot of work so thanks again @Bisaloo. The only outstanding actions we need before we can go ahead is to iterate the development version, and add a news item linking to this PR. We should also open an issue to address the no_contrasts
linting warning but I am happy to do that.
@pearsonca or @adrian-lison (or anyone else @epinowcast/developers ) who has a chance it would be great to get a second pair of eyes on this just to check nothing has slipped through as it is a lot of changes across the code base.
I have just made this issue and happy to merge this in with a failing lint check so it can be resolved there instead. |
Making sure I understand: should I increment to package version number to 0.2.0.7000? What is the preferred way to resolve conflicts? Should I rebase locally and force push or should I create a merge commit here? |
(yes though now it is at .8000 - I read somewhere this was a good idea and we decided to try it out but it is a real pain)
Whatever you would like with a slight preference for rebasing (because it is trendy). As we are using squash merging (😱) I am generally not hugely worried about PR commits as long as they are clear. |
Copied from r-lib/actions with some extra bells and whistles copied from lint.yaml - triggered on develop and can be triggered manually - can be skipped with the [ci skip] instruction in the commit message
Indents in function argument definition have not been changed because they are an explicit style choice
or that flag explicit style choices that diverge from default
c36a250
to
f99c193
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to go to me. Happy to see this merged in when you are ready @Bisaloo. Thanks again for the nice clean PR.
I think it's good to go. I can't merge it myself as one check is failing but feel free to do it whenever convenient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still all looks good to me so going to merge without a second review. Note this will cause lint checks on develop to fail but we have an issue open to resolve.
Fix #218
.lintr
configuration to enable non-default linters.lintr
configuration to disable linters that cause too many false positives or clash with design choices made in this repo (e.g. indents in function argument definition)If all goes well, only one lint should be remaining. It flags the fact that the
no_contrasts
variable is not usedenw_formula()
. I'm not completely sure what the right fix is here. Whetherno_contrasts
should just be removed here or if the wrong variable is passed at some point in place ofno_contrasts
.The other changes should mostly result in a more coherent styling but also in a slightly more performant code in some cases (5d7595f, d2e57ea, 4ae9ed2, 2906dc3 among others).