File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -295,7 +295,9 @@ lint:
295295
296296lint-fix :
297297 golangci-lint run --fix --out-format=tab --issues-exit-code=0
298- .PHONY : lint lint-fix
298+
299+ lint-fix-changed :
300+ ./scripts/linting/lint-changed-go-files.sh
299301
300302format :
301303 find . -name ' *.go' -type f -not -path " ./vendor*" -not -path " *.git*" -not -path " ./docs/client/statik/statik.go" -not -path " ./tests/mocks/*" -not -name ' *.pb.go' -not -name ' *.pb.gw.go' | xargs gofumpt -w
@@ -305,6 +307,11 @@ format:
305307docs-lint :
306308 markdownlint . --fix
307309
310+ docs-lint-changed :
311+ ./scripts/linting/lint-changed-md-files.sh
312+
313+ .PHONY : lint lint-fix lint-fix-changed docs-lint docs-lint-changed
314+
308315# ##############################################################################
309316# ## Protobuf ###
310317# ##############################################################################
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ # lint_modified_go_files runs the linter only if changes have been made to any go files.
6+ function lint_modified_go_files() {
7+ local go_files=" $( git diff --name-only | grep \. go$) "
8+ for f in $go_files ; do
9+ local dir_name=" $( dirname $f ) "
10+ golangci-lint run " ${dir_name} " --fix --out-format=tab --issues-exit-code=0
11+ done
12+ }
13+
14+ lint_modified_go_files
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ # lint_modified_markdown_files runs the linter only if changes have been made to any md files.
6+ function lint_modified_markdown_files() {
7+ local markdown_files=" $( git diff --name-only | grep \. md$) "
8+ for f in $markdown_files ; do
9+ markdownlint " ${f} " --fix
10+ done
11+ }
12+
13+ lint_modified_markdown_files
You can’t perform that action at this time.
0 commit comments