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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挕 Get rid of "trailing whitespace" or "no newline at EOF" errors on Travis #140

Open
geshuming opened this issue Oct 21, 2019 · 1 comment

Comments

@geshuming
Copy link

geshuming commented Oct 21, 2019

Issue

Travis seems to fail the build and emit Trailing whitespace or No newline at EOF errors, despite our team passing the corresponding gradle tasks checkstyleMain, checkstyleTest

image

Solution

Apparently this is due to the extra run-checks.sh script being run on travis. I added the following lines to the build.gradle file so that the check task also runs the travis script. Any suggestions are welcome.

task extrachecks(type: Exec) {
    commandLine 'bash', './config/travis/run-checks.sh'
}

tasks.check {
    dependsOn extrachecks
}

This way, you can run the check task on your local repo and fix any issues before submitting to travis.

@tysg
Copy link

tysg commented Oct 24, 2019

Just to add on, you will need git add the files that you have fixed before running the above command again. Otherwise, you may see the same error thrown despite having fixed the problem. The reason is that run-checks.sh will call git grep --cached which searches in the staging area.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants