diff --git a/.gitattributes b/.gitattributes index 8143bb75f..ec9895f39 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ -*.go text +*.go text eol=lf *.md text eol=lf *.json text eol=lf diff --git a/justfile b/justfile index 36e8ee3d6..e7f9fcdc5 100644 --- a/justfile +++ b/justfile @@ -22,8 +22,13 @@ unit-test: go test ./... -short # Run both unit tests and integration tests. +[unix] test: unit-test e2e-all +# On Windows, integration tests are not supported right now +[windows] +test: unit-test + # Generate all our auto-generated files (test list, cheatsheets, json schema, maybe other things in the future) generate: go generate ./... diff --git a/pkg/logs/tail/logs_windows.go b/pkg/logs/tail/logs_windows.go index cf7aa395f..b116cb405 100644 --- a/pkg/logs/tail/logs_windows.go +++ b/pkg/logs/tail/logs_windows.go @@ -11,8 +11,8 @@ import ( ) func tailLogsForPlatform(logFilePath string, opts *humanlog.HandlerOptions) { - var lastModified int64 = 0 - var lastOffset int64 = 0 + var lastModified int64 + var lastOffset int64 for { stat, err := os.Stat(logFilePath) if err != nil { diff --git a/scripts/check_commit.sh b/scripts/check_commit.sh index 9cc5e5c7b..37557462e 100755 --- a/scripts/check_commit.sh +++ b/scripts/check_commit.sh @@ -5,15 +5,13 @@ set -e -git diff --quiet || { - echo "Error: there are unstaged changes. Please stage or stash them before running this script." - exit 1 -} - just test just lint + +status_before_generate=$(git status --porcelain=v1) just generate -git diff --quiet || { +status_after_generate=$(git status --porcelain=v1) +if [[ "$status_after_generate" != "$status_before_generate" ]]; then echo "Error: auto-generated files not up to date." exit 1 -} +fi