chore(lint): replace docker-based precommit (#29)

This commit is contained in:
2025-07-14 16:48:43 +03:00
committed by GitHub
parent c91bfa0ccf
commit 1d2b68f059
3 changed files with 20 additions and 7 deletions

View File

@@ -1,10 +1,9 @@
repos: repos:
- repo: https://github.com/oxsecurity/megalinter - repo: https://github.com/golangci/golangci-lint
rev: v8.4.2 # Git tag specifying the hook, not mega-linter-runner, version rev: v1.57.2
hooks: hooks:
- id: megalinter-incremental # Faster, less thorough - id: golangci-lint
stages: args: ["--timeout=5m"]
- pre-commit
- repo: https://github.com/tekwizely/pre-commit-golang - repo: https://github.com/tekwizely/pre-commit-golang
rev: v1.0.0-rc.1 rev: v1.0.0-rc.1
hooks: hooks:

View File

@@ -26,9 +26,23 @@ go build -o gibidify .
## Usage ## Usage
```bash ```bash
./gibidify -source <source_directory> -destination <output_file> [--prefix="..."] [--suffix="..."] ./gibidify \
-source <source_directory> \
-destination <output_file> \
-format markdown|json|yaml \
-concurrency <num_workers> \
--prefix="..." \
--suffix="..."
``` ```
Flags:
- `-source`: directory to scan.
- `-destination`: output file path (optional; defaults to `<source>.<format>`).
- `-format`: output format (`markdown`, `json`, or `yaml`).
- `-concurrency`: number of concurrent workers.
- `--prefix` / `--suffix`: optional text blocks.
## Docker ## Docker
A Docker image can be built using the provided Dockerfile: A Docker image can be built using the provided Dockerfile:

View File

@@ -130,7 +130,7 @@ func setDestination() error {
} }
func startWorkers(ctx context.Context, wg *sync.WaitGroup, fileCh chan string, writeCh chan fileproc.WriteRequest) { 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) wg.Add(1)
go func() { go func() {
defer wg.Done() defer wg.Done()