Skip to content

Conversation

@hswong3i
Copy link

To follow Git's implementation, use GitIgnoreSpec.from_lines(...). The change for using this is Git allows including files from excluded directories which directly contradicts the gitignore docs.

See #800 (comment)

Fixes #800

@coveralls
Copy link

Coverage Status

coverage: 99.815%. remained the same
when pulling 2531053 on alvistack:GitIgnoreSpec
into 73b9c0b on adrienverge:master.

2 similar comments
@coveralls
Copy link

Coverage Status

coverage: 99.815%. remained the same
when pulling 2531053 on alvistack:GitIgnoreSpec
into 73b9c0b on adrienverge:master.

@coveralls
Copy link

Coverage Status

coverage: 99.815%. remained the same
when pulling 2531053 on alvistack:GitIgnoreSpec
into 73b9c0b on adrienverge:master.

@coveralls
Copy link

coveralls commented Jan 12, 2026

Coverage Status

coverage: 99.815%. remained the same
when pulling 2b6b192 on alvistack:GitIgnoreSpec
into 73b9c0b on adrienverge:master.

hswong3i added a commit to alvistack/adrienverge-yamllint that referenced this pull request Jan 12, 2026
    git clean -xdf
    tar zcvf ../python-yamllint_1.37.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-yamllint.spec ../python-yamllint_1.37.1-1.spec
    cp ../python*-yamllint*1.37.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/adrienverge-yamllint-1.37.1/
    rm -rf ../python*-yamllint_1.37.1*.* ../yamllint*1.37.1*.*

See adrienverge#802

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
hswong3i added a commit to alvistack/ansible-ansible-lint that referenced this pull request Jan 12, 2026
hswong3i added a commit to alvistack/adrienverge-yamllint that referenced this pull request Jan 12, 2026
    git clean -xdf
    tar zcvf ../python-yamllint_1.37.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-yamllint.spec ../python-yamllint_1.37.1-1.spec
    cp ../python*-yamllint*1.37.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/adrienverge-yamllint-1.37.1/
    rm -rf ../python*-yamllint_1.37.1*.* ../yamllint*1.37.1*.*

See adrienverge#802

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@adrienverge
Copy link
Owner

Thanks @hswong3i!

I guess this new code will make yamllint crash if a user still has pathspec < 1.0.0. Could you update pyproject.toml to require pathspec ≥ 1.0.0?

Also we could take this suggestion from @cpburnz.

Last, could you change the commit title to something more easily understandable? I propose Require pathspec ≥ 1.0.0 and follow Git's gitignore implementation.

To follow Git's implementation, use GitIgnoreSpec.from_lines(...). The
change for using this is Git allows including files from excluded
directories which directly contradicts the gitignore docs.

See adrienverge#800 (comment)

Fixes adrienverge#800

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@hswong3i
Copy link
Author

@adrienverge as you wish 🫡

hswong3i added a commit to alvistack/adrienverge-yamllint that referenced this pull request Jan 13, 2026
    git clean -xdf
    tar zcvf ../python-yamllint_1.37.1.orig.tar.gz --exclude=.git .
    debuild -uc -us
    cp python-yamllint.spec ../python-yamllint_1.37.1-1.spec
    cp ../python*-yamllint*1.37.1*.{gz,xz,spec,dsc} /osc/home\:alvistack/adrienverge-yamllint-1.37.1/
    rm -rf ../python*-yamllint_1.37.1*.* ../yamllint*1.37.1*.*

See adrienverge#802

Signed-off-by: Wong Hoi Sing Edison <[email protected]>
@adrienverge
Copy link
Owner

@hswong3i thank you for the update. But it's still not good:
- not all pathspec.PathSpec occurrences were replaced,
- multiple code places could be simplified,
- commit doesn't do what it says (1.0.0 vs. 1.0.3).

To save time and release a fixed version quickly I implemented it (a bit differently), see #803.

Thanks again for initiating this 🙏

@hswong3i
Copy link
Author

@adrienverge thank you for your quick release, your changes looks much elegant than mine ;-)

@hswong3i hswong3i closed this Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pathspec=1.0.0 causes deprecation warnings

3 participants