-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
94 lines (76 loc) · 2.86 KB
/
Taskfile.yml
File metadata and controls
94 lines (76 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: '3'
tasks:
default:
# Эта задача выполняется по умолчанию при вызове 'task' без аргументов.
# Она скрыта из списка, так как у нее нет 'desc'.
cmds:
- task --list
- echo "task <name> --summary"
silent: true
mod:
desc: "Sync go.mod"
cmds:
- go mod download
- go mod tidy
lint:
desc: "Run linters"
summary: |
Run linters.
cmds:
- GOEXPERIMENT=synctest golangci-lint run
silent: true
run:
desc: "Run the server"
cmds:
- go run cmd/server/main.go
kill-port:
desc: "Kill specific port"
summary: |
Kill specific port.
EXAMPLE:
task kill-port -- 7171
cmds:
- lsof -ti:{{.CLI_ARGS}} | xargs kill -9
bench:
desc: "Run all benchmarks"
cmds:
- go test -bench=. -run=^$ ./test/
bench-mem:
desc: "Run all benchmarks with memory profiling"
cmds:
- go test -bench=. -run=^$ -benchmem ./test/
test:
desc: "Run all tests"
cmds:
- GOEXPERIMENT=synctest go test -ldflags "-extldflags -Wl,-w" -failfast -count=1 $(go list ./... | grep -v mocks)
test-short:
desc: "Run short tests with race detector"
cmds:
- GOEXPERIMENT=synctest go test -ldflags "-extldflags -Wl,-w" -short -race -failfast -count=1 $(go list ./... | grep -v mocks)
test-v:
desc: "Run all tests with verbose output"
cmds:
- GOEXPERIMENT=synctest go test -ldflags "-extldflags -Wl,-w" -v -failfast -count=1 $(go list ./... | grep -v mocks)
cleanup-git:
desc: "Clean up deleted files from Git history"
summary: |
Находит файлы, которые были удалены из рабочей директории, но остались в истории Git,
и предлагает удалить их с помощью git-filter-repo.
ВНИМАНИЕ: Эта операция изменяет историю только текущей ветки!
ТРЕБОВАНИЯ:
macOS: brew install git-filter-repo
Ubuntu: sudo apt install git-filter-repo
pip: pip install git-filter-repo
ПРИМЕНЕНИЕ:
task cleanup-git
ЧТО ДЕЛАЕТ:
1. Сканирует историю текущей ветки на предмет файлов
2. Сравнивает с текущим состоянием рабочей директории
3. Показывает список удаленных файлов
4. Предлагает удалить их из истории с помощью git-filter-repo
5. Работает только с текущей веткой (безопаснее)
ПОСЛЕ ВЫПОЛНЕНИЯ:
git push origin --force
cmds:
- ./script/cleanup_git.sh
silent: true