segmentio / golines

A golang formatter that fixes long lines
MIT License
903 stars 56 forks source link

Improve ignore capabilities #91

Open jgresty opened 1 year ago

jgresty commented 1 year ago

Currently there are two flags for ignoring files: --ignore-generated and --ignored-dirs.

--ignore-generated is very strict about what it considers a generated file, causing a lot of generated files to be considered not generated in many code bases.

--ignored-dirs only checks the last part of a path which can mean it will match a much larger set that intended if the ignored directory has a generic name. Additionally it is rather combersome to specify multile directories as the flag needs to be repeated and it is quite long (granted not a major concern).

Ideally I would like to see ignores specified as regular expressions on the whole path, similar to how golangci-lint handles its skip-dirs configuration