Closed MansMeg closed 5 years ago
The reason why it failed in travis can be seen in the error message here: https://travis-ci.org/MansMeg/posteriordb/jobs/601185982
Trim Trailing Whitespace.................................................Failed
hookid: trailing-whitespace
Files were modified by this hook. Additional output:
Fixing rpackage/tests/testthat/test-content.R
I created a PR #58 that strips this trailing whitespace and re-enables python3.7 job (this is the job that performs general linting like checking for trailing whitespace)
You can install pre-commit hooks that help notice trailing whitespace before committing (or you can choose to run the hooks also only before git push
if you prefer). The instructions are here https://github.com/MansMeg/posteriordb/blob/master/CONTRIBUTING.md
If you don't want to run the checks automatically you can also replicate what the CI does by locally running
pre-commit run --all-files
This will automatically fix trailing whitespace issues, you'll only have to commit the changes afterwards (this is what Files were modified by this hook
means in the error message)
You can also have RStudio remove trailing whitespace automatically when saving, see https://support.rstudio.com/hc/en-us/articles/200549016-Customizing-RStudio?mobile_site=true and "Strip trailing horizontal whitespace when saving"
You might also want to enable "Ensure that source files end with a new line" as CI checks for that as well.
Ah alright, so it is actually a problem with the R code?
Yeah in this case the error was with general checks that apply to all files. There are also python-specific tests in the same job. I'll see if I can make a separate job for the general linting-like checks so it will be easier to pinpoint where the failure comes from
PR #60 separates the generic checks from python package tests
It fails in Travis so I commented it out. I leave this as an issue.