Skip to content

fix(identify): classify named pipes - #621

Closed
awais-ur-rehman wants to merge 1 commit into
pre-commit:mainfrom
awais-ur-rehman:feat/classify-named-pipes
Closed

awais-ur-rehman wants to merge 1 commit into
pre-commit:mainfrom
awais-ur-rehman:feat/classify-named-pipes

Conversation

@awais-ur-rehman

Copy link
Copy Markdown

Summary

Running identify-cli on a named pipe with no writer blocks when identification tries to read the path. Use the mode from lstat to return the fifo tag before inspecting contents, as identification already does for sockets and symlinks.

This addresses the named-pipe part of #72. The socket part was handled in #177.

Breaking Changes

None. Named pipes now return the fifo type tag.

Testing

  • On a POSIX system, run mkfifo test-pipe and then identify-cli test-pipe. The command should immediately print ["fifo"] without a writer.
  • Run coverage run -m pytest tests and coverage report with the license extra and test dependencies installed. All 554 tests passed on Python 3.11 and 3.14.
  • Run pre-commit run --all-files --show-diff-on-failure.

Codex assisted with the reproduction, patch, and tests.

@asottile asottile closed this Nov 4, 2026
@pre-commit pre-commit locked as spam and limited conversation to collaborators Nov 4, 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