/
niceSOFT
/
python3-pathspec
Обзор
Документация
Войти
/
niceSOFT
/
python3-pathspec
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.1.1
tests/check_usage.py
49 строк
922 B
Caleb Burns
Improve type checking with mypy and pyright
27 апр 2026, 03:52
Не верифицирован
27 апр 2026, 03:52
6727491
Код
Авторство
О чём код?
# pyright: strict from pathspec import ( PathSpec, GitIgnoreSpec) from pathspec.patterns.gitignore.basic import ( GitIgnoreBasicPattern) def check_gi_1(): spec = GitIgnoreSpec.from_lines(['**']) return spec def check_gi_2(): pattern = 'gitignore' spec = GitIgnoreSpec.from_lines(pattern, ['**']) return spec def check_gi_3(): pattern = 'gitignore' spec = GitIgnoreSpec.from_lines(['**'], pattern) return spec def check_ps_1(): spec = PathSpec.from_lines('gitignore', ['**']) return spec def check_ps_2(): pat_type = 'gitignore' spec = PathSpec.from_lines(pat_type, ['**']) return spec def check_ps_3(): spec = PathSpec.from_lines(GitIgnoreBasicPattern, ['**']) return spec def check_ps_4(): from typing import AnyStr def pattern_factory(pattern: AnyStr) -> GitIgnoreBasicPattern: return GitIgnoreBasicPattern(pattern) spec = PathSpec.from_lines(pattern_factory, ['**']) return spec