From 1d2b68f059ef97b30b454c1d780a5d6bf7b3b755 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 14 Jul 2025 16:48:43 +0300 Subject: [PATCH] chore(lint): replace docker-based precommit (#29) --- .pre-commit-config.yaml | 9 ++++----- README.md | 16 +++++++++++++++- main.go | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84e9943..57cc76d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,9 @@ repos: - - repo: https://github.com/oxsecurity/megalinter - rev: v8.4.2 # Git tag specifying the hook, not mega-linter-runner, version + - repo: https://github.com/golangci/golangci-lint + rev: v1.57.2 hooks: - - id: megalinter-incremental # Faster, less thorough - stages: - - pre-commit + - id: golangci-lint + args: ["--timeout=5m"] - repo: https://github.com/tekwizely/pre-commit-golang rev: v1.0.0-rc.1 hooks: diff --git a/README.md b/README.md index 73a0209..7c882dc 100644 --- a/README.md +++ b/README.md @@ -26,9 +26,23 @@ go build -o gibidify . ## Usage ```bash -./gibidify -source -destination [--prefix="..."] [--suffix="..."] +./gibidify \ + -source \ + -destination \ + -format markdown|json|yaml \ + -concurrency \ + --prefix="..." \ + --suffix="..." ``` +Flags: + +- `-source`: directory to scan. +- `-destination`: output file path (optional; defaults to `.`). +- `-format`: output format (`markdown`, `json`, or `yaml`). +- `-concurrency`: number of concurrent workers. +- `--prefix` / `--suffix`: optional text blocks. + ## Docker A Docker image can be built using the provided Dockerfile: diff --git a/main.go b/main.go index 6e9a995..6510a7c 100644 --- a/main.go +++ b/main.go @@ -130,7 +130,7 @@ func setDestination() error { } func startWorkers(ctx context.Context, wg *sync.WaitGroup, fileCh chan string, writeCh chan fileproc.WriteRequest) { - for range concurrency { + for i := 0; i < concurrency; i++ { wg.Add(1) go func() { defer wg.Done()