Add support for character classes
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 22
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
Or more generally: support what gitignore supports.
As of right now, .dockerignore files with changes such as https://github.com/github/gitignore/commit/7b35656e7517d529f183f78c5ec33e3e741bd049 will cause the engine to choke and die with an error like ERROR: failed to solve: Internal: rpc error: code = Internal desc = rpc error: code = Internal desc = header key "exclude-patterns" contains value with non-printable ASCII characters.
My recommendation: move away from DIY ignorefile parsing and use an existing lib, maybe even a part of go-git's implementation. I'd personally recommend a lib instead of a source code copy, but they are Apache 2 as well, so there shouldn't be any license issue from code copying - just a maintenance burden, but one I'd argue is less than the current maintenance burden.
This kind of change might be a breaking change for some users: matching outcomes may change for
- malformed/ambiguous patterns,
- path normalization differences (filepath.Clean, separators),
- bracket/escape semantics,
- negation ordering edge cases.
However I'd argue that this is worth it:
- users can use standard snippets, including the same blocks they use in their other
.*ignorefiles, - users that complain about the structure or feature support of the file format can be pointed at git's dev team. :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current DIY ignorefile parser and the go-git implementation linked in the issue. Define coverage for character classes and broader gitignore behavior, including malformed patterns, path normalization, escaping, and negation ordering. Done means supported .dockerignore patterns no longer cause the engine to fail, with compatibility changes understood and tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100