Skip to content

Close files inspected by LineEndings - #921

Open
oleksii-leonov wants to merge 1 commit into
sds:mainfrom
oleksii-leonov:fix/close-line-ending-files
Open

oleksii-leonov wants to merge 1 commit into
sds:mainfrom
oleksii-leonov:fix/close-line-ending-files

Conversation

@oleksii-leonov

Copy link
Copy Markdown

LineEndings opens every inspected file without explicitly closing it. Large commits and whole-repository checks can exhaust file descriptors before garbage collection runs, including in other concurrent hooks.

Use a File.open block so each file closes after validation. Keep the encoding-warning handler inside the block so it can still read the file's line number before the file closes.

LineEndings opens every inspected file without explicitly closing it.
Large commits and whole-repository checks can exhaust file descriptors
before garbage collection runs, including in other concurrent hooks.

Use a File.open block so each file closes after validation. Keep the
encoding-warning handler inside the block so it can still read the
file's line number before the file closes.

This branch has not been deployed

No deployments
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.

1 participant