Skip to content

Identify named pipes without reading their contents - #622

Closed
umrndem wants to merge 1 commit into
pre-commit:mainfrom
umrndem:fix-identify-fifo
Closed

umrndem wants to merge 1 commit into
pre-commit:mainfrom
umrndem:fix-identify-fifo

Conversation

@umrndem

@umrndem umrndem commented Nov 14, 2026 •

Copy link
Copy Markdown

Named pipes currently fall through regular-file handling. An unrecognized filename can block while its contents are opened, and a recognized extension can classify the pipe as a regular file.

Detect FIFOs alongside the existing special file types and expose the fifo tag through the type-tag registry. Regression tests use real named pipes with and without a recognized extension and forbid opening their contents.

Addresses the remaining named-pipe case in #72; socket handling is already present.

Validation:

  • New regression cases fail on the original implementation.
  • tox -e py: 555 passed, 100% statement and branch coverage.
  • tox -e pre-commit: all configured hooks passed.
  • git diff --check: passed.

@asottile asottile closed this Nov 14, 2026
@pre-commit pre-commit locked as spam and limited conversation to collaborators Nov 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants