Skip to content

Instantly share code, notes, and snippets.

View ArturGajowy's full-sized avatar
🐑
Yakshaving the yakshaver

Artur Gajowy ArturGajowy

🐑
Yakshaving the yakshaver
View GitHub Profile
@ArturGajowy
ArturGajowy / post-commit.sh
Created April 27, 2020 13:52
Formatting commit hooks done right
#!/bin/bash
set -e -x
if [ -a .commit ]
then
rm .commit
# We format partially-staged files in the pre-commit hook, as that's the only safe way.
# If a partially-staged file needed reformatting, it's been re-formatted in pre-commit,
# and the commit has been cancelled so that the user can re-add the re-formmatted hunks.
package com.example
import spock.lang.Ignore
import spock.lang.Specification
class StubAfterStubSpec extends Specification {
private static final DEFAULT_STUBBING = 42
def stub