gitignore_parser icon indicating copy to clipboard operation
gitignore_parser copied to clipboard

A spec-compliant gitignore parser for Python 3.5+

Results 16 gitignore_parser issues
Sort by recently updated
recently updated
newest added

re.search will find substrings unless we anchor. I *think* all gitignore rules should be anchored but I'm not 100% sure (hard to tell without test coverage). Another solution could be...

For anchored matches, the `^` is being inserted before the flags: ```pycon >>> import gitignore_parser >>> from pathlib import Path >>> gitignore_parser.rule_from_pattern("/foo", Path(".").resolve()).match("42") /home/mdk/clones/gitignore_parser/gitignore_parser.py:143: DeprecationWarning: Flags not at the start...

I have a file that is a symbolic link to another location, e.g., /one/two/three -> /four/five/six. When using parse_gitignore on the symlink path (/one/two/three) it throws a ValueError: raise ValueError("{!r}...

Hello, looking at your plea for minimal Pull Requests, I decided to add a PR for a [EditorConfig](https://editorconfig.org/) first before considering other Pull Requests. In short: the `.editorconfig` will enforce...

.gitignore contents: build `/abcbuild` matches even though such a pattern is supposed to only match if the file name is exactly that.

Hi, The premise of this issue is that I want to ignore patterns from `.gitignore` and `.git/info/exclude` as well (for local ignores). For performance reasons, it's probably better to use...

To put it in code, I think that this one shall pass: ```python def test_ignore_directory_no_slash(self): matches = _parse_gitignore_string('.venv', fake_base_dir='/home/michael') self.assertTrue(matches('/home/michael/.venv')) self.assertTrue(matches('/home/michael/.venv/folder')) self.assertTrue(matches('/home/michael/.venv/file.txt')) ``` Because according to `man gitignore`: ```text $...

This add a `TestCase` to run all tests against git, thus ensuring that current tests, and all future tests, are compliant with git.

hey @mherrmann. thanks for this python module. we discovered that a .gitignore with a leading slash directory doesn't work you will see all files within the root directory for instance...

With recent changes to start using `Path`, gitignore_parser lost some support for Windows which was not caught due to CI not running on a windows runner. Also, I added python...