mirror of
https://github.com/ivuorinen/gibidify.git
synced 2026-02-23 22:53:13 +00:00
chore(lint): replace docker-based precommit (#29)
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -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:
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user