Skip to content

Commit 32185d0

Browse files
committed
Misc
1 parent a8ceca7 commit 32185d0

File tree

4 files changed

+70
-1
lines changed

4 files changed

+70
-1
lines changed

CHANGES.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@ Change History
33
==============
44

55

6+
0.10.2 (TBD)
7+
------------
8+
9+
TODO:
10+
11+
- Fix test failures on Windows: https://github.com/cpburnz/python-pathspec/runs/8192308694?check_suite_focus=true
12+
13+
Improvements:
14+
15+
- `Issue #58`_: CI: add GitHub Actions test workflow.
16+
17+
18+
.. _`Issue #58`: https://github.com/cpburnz/python-pathspec/pull/58
19+
20+
621
0.10.1 (2022-09-02)
722
-------------------
823

pathspec/_meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
"bzakdd <https://github.com/bzakdd>",
4949
]
5050
__license__ = "MPL 2.0"
51-
__version__ = "0.10.1"
51+
__version__ = "0.10.2.dev1"

tests/test_gitignore.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,30 @@ def test_04_issue_62(self):
311311
'anydir/file.txt',
312312
'product_dir/file.txt',
313313
})
314+
315+
def test_05_issue_39(self):
316+
"""
317+
Test excluding files in a directory.
318+
"""
319+
spec = GitIgnoreSpec.from_lines([
320+
'*.log',
321+
'!important/*.log',
322+
'trace.*',
323+
])
324+
files = {
325+
'a.log',
326+
'b.txt',
327+
'important/d.log',
328+
'important/e.txt',
329+
'trace.c',
330+
}
331+
ignores = set(spec.match_files(files))
332+
self.assertEqual(ignores, {
333+
'a.log',
334+
'trace.c',
335+
})
336+
self.assertEqual(files - ignores, {
337+
'b.txt',
338+
'important/d.log',
339+
'important/e.txt',
340+
})

tests/test_pathspec.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,3 +537,30 @@ def test_07_issue_62(self):
537537
self.assertEqual(results, {
538538
'anydir/file.txt',
539539
})
540+
541+
def test_08_issue_39(self):
542+
"""
543+
Test excluding files in a directory.
544+
"""
545+
spec = PathSpec.from_lines('gitwildmatch', [
546+
'*.log',
547+
'!important/*.log',
548+
'trace.*',
549+
])
550+
files = {
551+
'a.log',
552+
'b.txt',
553+
'important/d.log',
554+
'important/e.txt',
555+
'trace.c',
556+
}
557+
ignores = set(spec.match_files(files))
558+
self.assertEqual(ignores, {
559+
'a.log',
560+
'trace.c',
561+
})
562+
self.assertEqual(files - ignores, {
563+
'b.txt',
564+
'important/d.log',
565+
'important/e.txt',
566+
})

0 commit comments

Comments
 (0)