New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit detect_private_key to ignore directories #201

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@jakob223

jakob223 commented Jun 19, 2017

Currently if given a directory, detect_private_key tries to open it as a file and spews errors as a result. The behavior of this should either recursively search the directory or ignore the directory instead. This code ignores the directory.

@asottile

This comment has been minimized.

Show comment
Hide comment
@asottile

asottile Jun 19, 2017

Member

pre-commit should never pass a directory to this -- I'm not sure this is a case that should be defended against?

Member

asottile commented Jun 19, 2017

pre-commit should never pass a directory to this -- I'm not sure this is a case that should be defended against?

@jakob223

This comment has been minimized.

Show comment
Hide comment
@jakob223

jakob223 Jun 19, 2017

Hmm, I had a check failing because it was trying to open directories. I'll check back tomorrow and update with more information.

jakob223 commented Jun 19, 2017

Hmm, I had a check failing because it was trying to open directories. I'll check back tomorrow and update with more information.

@asottile

This comment has been minimized.

Show comment
Hide comment
@asottile

asottile Jun 19, 2017

Member

Ah yeah, probably this issue: pre-commit/pre-commit#191 (comment) (running against submodules)

we plan to handle this in a more blanket way in the framework such that every hook doesn't need to guard against running on directories.

There's a wip branch which enables hooks "by type" (which would disable linting "subodule directories" by default unless a hook opted into them). @chriskuehl and I hope to finalize this branch soon (though we've both been pretty busy)

Member

asottile commented Jun 19, 2017

Ah yeah, probably this issue: pre-commit/pre-commit#191 (comment) (running against submodules)

we plan to handle this in a more blanket way in the framework such that every hook doesn't need to guard against running on directories.

There's a wip branch which enables hooks "by type" (which would disable linting "subodule directories" by default unless a hook opted into them). @chriskuehl and I hope to finalize this branch soon (though we've both been pretty busy)

@jakob223

This comment has been minimized.

Show comment
Hide comment
@jakob223

jakob223 Jun 20, 2017

Yep, now I remember that it was a submodule. If this is being solved in that way, then I'm happy to close this PR.

jakob223 commented Jun 20, 2017

Yep, now I remember that it was a submodule. If this is being solved in that way, then I'm happy to close this PR.

@asottile

This comment has been minimized.

Show comment
Hide comment
@asottile

asottile Jul 3, 2017

Member

This is now the default behaviour (see the linked ticket) in 0.15.0. See pre-commit/pre-commit#551

Member

asottile commented Jul 3, 2017

This is now the default behaviour (see the linked ticket) in 0.15.0. See pre-commit/pre-commit#551

@asottile asottile closed this Jul 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment