-
Notifications
You must be signed in to change notification settings - Fork 991
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 a GHA for linting code #5908
Conversation
This PR touches many files and is likely to cause conflicts to long queue of PRs we have. We could consider adding just linter for now, and now fixing what it detects, and before 1.16.0, when, hopefully most, of PRs will be merged, then merge rest of this PR. |
My thinking with only applying whitespace changes (besides vignettes, which don't have much in the queue anyway, and the changes are ~mostly whitespace-only too) is it's not likely to cause any troubling merge conflicts. It also lets us turn on more repo-wide linters up-front. |
* Fix 5492 by limiting the costly deparse to `nlines=1` * Implementing PR feedbacks * Added inside * Fix typo in name * Idiomatic use of inside * Separating the deparse line limit to a different PR --------- Co-authored-by: Michael Chirico <chiricom@google.com>
* Added my improvements to the intro vignette * Removed two lines I added extra as a mistake earlier * Requested changes
* fix typos and grammatical mistakes * fix typos and punctuation * remove double spaces where it wasn't necessary * fix typos and adhere to British English spelling * fix typos * fix typos * add missing closing bracket * fix typos * review fixes * Update vignettes/datatable-benchmarking.Rmd Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * Update vignettes/datatable-benchmarking.Rmd Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * Apply suggestions from code review benchmarking Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * remove unnecessary [ ] from datatable-keys-fast-subset.Rmd * Update vignettes/datatable-programming.Rmd Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * Update vignettes/datatable-reshape.Rmd Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * One last batch of fine-tuning --------- Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> Co-authored-by: Michael Chirico <chiricom@google.com>
* Updated documentation for rbindlist(fill=TRUE) * Print NULL entries of list as NULL * Added news item * edit NEWS, use '[NULL]' not 'NULL' * fix test * split NEWS item * add example --------- Co-authored-by: Michael Chirico <chiricom@google.com> Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> Co-authored-by: Benjamin Schwendinger <benjamin.schwendinger@tuwien.ac.at>
* clarify that list input->unnamed list output * Add example where make.names is used * mention role of make.names
* fix subsetting issue in split.data.table * add a test * drop=FALSE on inner [
* Allow early exit from check for eval/evalq in cedta Done in the browser+untested, please take a second look :) * Use %chin% * nocov new code
* frollmax exact, buggy fast, no fast adaptive * frollmax fast fixing bugs * frollmax man to fix CRAN check * frollmax fast adaptive non NA, dev * froll docs, adaptive left * no frollmax fast adaptive * frollmax adaptive exact NAs handling * PR summary in news * copy-edit changes from reviews Co-authored-by: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> Co-authored-by: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com> * comment requested by Michael * update NEWS file * Apply suggestions from code review Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * Apply suggestions from code review Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * add comment requested by Michael * add comment about int iterator for loop over k-1 obs * extra comments * Revert "extra comments" This reverts commit 03af0e3. * add comments to frollmax and frollsum * typo fix --------- Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> Co-authored-by: Benjamin Schwendinger <52290390+ben-schwen@users.noreply.github.com>
* friendlier error in assignment with trailing comma e.g. `DT[, `:=`(a = 1, b = 2,)`. WIP. Need to add tests and such, but editing from browser before I forget. * Another pass * include unnamed indices on RHS too * tests * NEWS * test numbering * explicit example in NEWS
1edf380
to
f658ff4
Compare
ed8cced
to
f4a1f48
Compare
cc @jangorecki again for review |
Related to #6040 -- it will be good to keep to a pattern where `test()` always has a numeric literal in the `num=` argument, even if it's a dynamic test where the base number is incremented by a variable amount. Doing so will make the `testPattern=` argument to `test.data.table()` more usable. We can add a linter for this (#5908) to prevent regression later. <details> Linter to find these: ```r l=make_linter_from_xpath( "//SYMBOL_FUNCTION_CALL[text() = 'test']/parent::expr/following-sibling::expr[1][SYMBOL or expr[1]/SYMBOL]", "xxx") lint("inst/tests/tests.Rraw", l()) ``` </details>
@tdhock it would be great to get this merged so we can start enforcing more incremental code quality going forward, PTAL. thanks! |
Generated via commit 2558ecb Download link for the artifact containing the test results: ↓ atime-results.zip Time taken to finish the standard R installation steps: 11 minutes and 57 seconds Time taken to run |
cc @Anirban166 for the trailing whitespace changes here / possible need to update #6094 |
Pared down version of #4278 to only add the GHA, and some whitespace-only code changes.
With this, we can start enforcing rules that we already obey ourselves.
Next, we can add a separate 'lint-new' workflow to enforce rules on new code, i.e. lints already in
master
won't throw, but lints in new PRs will need to be fixed.Eventually, all lints on master can be fixed and we can remove the 'lint-new' workflow.