-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
184 lines (160 loc) · 3.85 KB
/
Taskfile.yml
File metadata and controls
184 lines (160 loc) · 3.85 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Taskfile for Obsidian Tools
# See https://taskfile.dev for documentation
version: "3"
# Global variables used across tasks
vars:
BUILD_DIR: ./validate-plugin-manifest
BINARY_NAME: obsidian-validate-plugin-manifest
tasks:
default:
desc: Display available tasks
cmds:
- task --list-all
silent: true
setup:
desc: Setup development environment with all dependencies
cmds:
- echo "Installing dependencies from Brewfile..."
- brew bundle
verify:
desc: Verify development environment is correctly set up
cmds:
- echo "Verifying development tools..."
- go version
- golangci-lint --version
- gofumpt --version
- prettier --version
- task --version
build:
desc: Build the validate-plugin-manifest tool
cmds:
- echo "Building {{.BINARY_NAME}}..."
- go build -o {{.BINARY_NAME}} {{.BUILD_DIR}}
sources:
- "{{.BUILD_DIR}}/**/*.go"
- "go.mod"
- "go.sum"
generates:
- "{{.BINARY_NAME}}"
build:all:
desc: Build all tools in the repository
cmds:
- echo "Building all tools..."
- task: build
clean:
desc: Remove all build artifacts
cmds:
- echo "Cleaning build artifacts..."
- rm -f {{.BINARY_NAME}}
quality:
desc: Run all code quality checks (lint and format)
cmds:
- echo "Running all code quality checks..."
- task: lint
- task: format
fix:
desc: Automatically fix all linting and formatting issues
cmds:
- echo "Fixing all code quality issues..."
- task: lint:fix
- task: format
lint:
desc: Run all linters
cmds:
- echo "Running all linters..."
- task: lint:go
lint:fix:
desc: Automatically fix linting issues
cmds:
- echo "Fixing linting issues..."
- task: lint:go:fix
lint:go:
desc: Lint Go code
sources:
- "**/*.go"
- ".golangci.yml"
cmds:
- golangci-lint run ./...
lint:go:fix:
desc: Automatically fix Go linting issues
sources:
- "**/*.go"
- ".golangci.yml"
cmds:
- golangci-lint run --fix ./...
- gofumpt -l -w .
format:
desc: Format all code according to style guidelines
cmds:
- echo "Formatting all code..."
- task: format:go
- task: format:markdown
format:go:
desc: Format Go code
sources:
- "**/*.go"
cmds:
- gofumpt -l -w .
format:markdown:
desc: Format Markdown files
sources:
- "**/*.md"
cmds:
- prettier --write "**/*.md"
test:
desc: Run all tests
sources:
- "**/*.go"
- "go.mod"
- "go.sum"
cmds:
- echo "Running tests..."
- go test -v ./...
test:cover:
desc: Run tests with coverage report
sources:
- "**/*.go"
- "go.mod"
- "go.sum"
cmds:
- echo "Running tests with coverage..."
- go test -cover ./...
test:race:
desc: Run tests with race condition detection
sources:
- "**/*.go"
- "go.mod"
- "go.sum"
cmds:
- echo "Running tests with race detection..."
- go test -race ./...
run:
desc: Run the validator with default settings
deps: [build]
cmds:
- echo "Running {{.BINARY_NAME}}..."
- ./{{.BINARY_NAME}}
run:json:
desc: Run the validator with JSON output
deps: [build]
cmds:
- echo "Running {{.BINARY_NAME}} with JSON output..."
- ./{{.BINARY_NAME}} --json
update:deps:
desc: Update all Go dependencies
cmds:
- echo "Updating dependencies..."
- go get -u ./...
- go mod tidy
ci:
desc: Run all checks for CI/CD pipelines
cmds:
- echo "Running CI checks..."
- task: quality
- task: test
pre-commit:
desc: Run checks before committing
cmds:
- echo "Running pre-commit checks..."
- task: quality
- task: test