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 a GHA for linting code #5908

Merged
merged 51 commits into from
Apr 23, 2024
Merged

Add a GHA for linting code #5908

merged 51 commits into from
Apr 23, 2024

Conversation

MichaelChirico
Copy link
Member

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.

@jangorecki
Copy link
Member

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.

@MichaelChirico
Copy link
Member Author

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.

MichaelChirico and others added 13 commits January 14, 2024 15:12
* 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
…ehavior (#5635)

* fread is similar to read.delim (#5634)

* Use ?read.csv / ?read.delim

---------

Co-authored-by: Michael Chirico <chiricom@google.com>
Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
@MichaelChirico MichaelChirico added this to the 1.16.0 milestone Feb 19, 2024
@MichaelChirico
Copy link
Member Author

cc @jangorecki again for review

MichaelChirico added a commit that referenced this pull request Apr 9, 2024
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>
@MichaelChirico
Copy link
Member Author

@tdhock it would be great to get this merged so we can start enforcing more incremental code quality going forward, PTAL. thanks!

Copy link

github-actions bot commented Apr 20, 2024

Comparison Plot

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 atime::atime_pkg on the tests: 2 minutes and 59 seconds

@MichaelChirico
Copy link
Member Author

cc @Anirban166 for the trailing whitespace changes here / possible need to update #6094

.ci/.lintr.R Show resolved Hide resolved
@MichaelChirico MichaelChirico merged commit 6db0eda into master Apr 23, 2024
2 of 3 checks passed
@MichaelChirico MichaelChirico deleted the linter-ci branch April 23, 2024 19:12
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.

8 participants