Skip to content

Add Option to accept list of files #8

@sp71

Description

@sp71

DESCRIPTION

  • Its often to not format all files
  • Example: vendor folder, protobuf generated files, etc

REQUEST

  • Add an option where the image accepts a list of files to process
  • Or provide options to ignore vendor and/or protobuf generated files since they are used often

WORKAROUND

  • Running docker run on each file is much slower with this workaround
#!/bin/bash

files=$(find . -type f -name "*.go" | grep -v vendor | grep -v pb.go)
for f in $files; do
    diff=$(docker run --rm -v $(pwd):/data cytopia/goimports -d $f)
    if [[ "$diff" != "" ]]; then
        echo "File fails goimports linter: $f"
        exit 2
    fi
done

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions