design-system-react icon indicating copy to clipboard operation
design-system-react copied to clipboard

Remove pre-push tests, move linting back to pre-commit

Open tweettypography opened this issue 10 years ago • 8 comments

In #277 the tests were moved to pre-push instead of pre-commit. Travis CI runs the tests, so adding them to push seems redundant and slows things down, and linting is actually useful on each commit (and can be easily skipped if needed)

tweettypography avatar May 17 '16 14:05 tweettypography

@interactivellama I know you mentioned something like this in the comments on the PR. Thoughts?

tweettypography avatar May 17 '16 14:05 tweettypography

I'm fine with moving linting back to commit if once all the files pass lint. I think it just got added back in because all of us remove it to work and then add it back in out of habit.

The frustrating part of commit checks is that if you are currently looking through 3 different branches and your package.json files has been changed. You will get a merge conflict, so every branch you change to you have to modify the package.json. Maybe I'm doing something wrong, but I find myself removing the pre-commit checks sometimes three times in a row, in order to switch between stashes and branches.

In a typical PR/task that I do, I have usually end up using 3 branches. One of when I originally started and have commits in it (with commit checks removed). Once there are conflicts, I create a second branch from master and then pull down origin/master. I then cherry pick my commits on top of it or something similar. If I do it wrong, I might end up using a third branch.

interactivellama avatar May 17 '16 15:05 interactivellama

There's no reason to add or remove the commit checks from package.json... Theoretically any lint errors are caused by your own changes so you should be fixing them anyway. And while at the moment there are some existing errors in the repo you can always use the --no-verify flag to skip the hooks

tweettypography avatar May 17 '16 17:05 tweettypography

I guess I need to clarify, I'm fine with linting commit checks once we have a a new eslint config and we have a task to clean it up. Until then, let's do something else and make changing to commit a part of the eslint task.

interactivellama avatar May 17 '16 17:05 interactivellama

@donnieberg @tweettypography @futuremint Do we want to remove running tests and npm ls locally on push and just allow TravisCI to run as the original issue was created?

interactivellama avatar Aug 23 '16 16:08 interactivellama

@interactivellama I like having the hook because it's one less thing I have to remember to do :) But it makes sense to only have it on either the commit hook or the push hook, not both.

donnieberg avatar Aug 23 '16 16:08 donnieberg

OK, we'll keep them in for now.

interactivellama avatar Aug 23 '16 16:08 interactivellama

I'm late to the party, but I personally prefer pre-push for running unit tests, because frequently not all the unit tests are done & working on every commit (I like to make frequent small commits, and sometimes will fix up broken unit tests toward the end)

futuremint avatar Aug 23 '16 18:08 futuremint