René's URL Explorer Experiment


Title: `file-contents-sorter` adds an extra blank line if the file to be sorted is empty · Issue #935 · pre-commit/pre-commit-hooks · GitHub

Open Graph Title: `file-contents-sorter` adds an extra blank line if the file to be sorted is empty · Issue #935 · pre-commit/pre-commit-hooks

X Title: `file-contents-sorter` adds an extra blank line if the file to be sorted is empty · Issue #935 · pre-commit/pre-commit-hooks

Description: I am on v.4.4.0, Python 3.11.4, macOS Ventura 13.4.1. My .pre-commit-config.yaml: repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v4.4.0" hooks: - id: end-of-file-fixer - id: file-contents-sorter files: ^requirements\...

Open Graph Description: I am on v.4.4.0, Python 3.11.4, macOS Ventura 13.4.1. My .pre-commit-config.yaml: repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v4.4.0" hooks: - id: end-of-file-fixer - id: fi...

X Description: I am on v.4.4.0, Python 3.11.4, macOS Ventura 13.4.1. My .pre-commit-config.yaml: repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v4.4.0" hooks: - id: end-of-file-fixe...

Opengraph URL: https://github.com/pre-commit/pre-commit-hooks/issues/935

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`file-contents-sorter` adds an extra blank line if the file to be sorted is empty","articleBody":"I am on `v.4.4.0`, Python `3.11.4`, macOS Ventura `13.4.1`.\r\n\r\nMy `.pre-commit-config.yaml`:\r\n\r\n```yaml\r\nrepos:\r\n  - repo: https://github.com/pre-commit/pre-commit-hooks\r\n    rev: \"v4.4.0\"\r\n    hooks:\r\n      - id: end-of-file-fixer\r\n      - id: file-contents-sorter\r\n        files: ^requirements\\/.+\\.in$\r\n        # args: [--unique, --ignore-case]\r\n```\r\n\r\nThe files are intentionally **empty** \u0026ndash; I'm in the planning stage, they are just placeholders for requriements[^1].\r\n\r\nTo the point: `file-contents-sorter` adds an extra blank to them, what results in a confict with `end-of-file-fixer`. I am not sure if that is the expected behavior... Updating `args` doesn't have any effect.\r\n\r\n```bash\r\n$ git:(install-and-configure-pre-commit) : pre-commit run --all-files\r\nfix end of files.........................................................Failed\r\n- hook id: end-of-file-fixer\r\n- exit code: 1\r\n- files were modified by this hook\r\n\r\nFixing requirements/build.in\r\nFixing requirements/lint.in\r\nFixing requirements/test.in\r\n\r\nfile contents sorter.....................................................Failed\r\n- hook id: file-contents-sorter\r\n- exit code: 1\r\n- files were modified by this hook\r\n\r\nSorting requirements/build.in\r\nSorting requirements/lint.in\r\nSorting requirements/test.in\r\n```\r\n\r\n[^1]: Yes, I know that I can use `requirements-txt-fixer` particularly for requirements. 😄 I will do. For that issue it doesn't matter.","author":{"url":"https://github.com/paduszyk","@type":"Person","name":"paduszyk"},"datePublished":"2023-07-20T10:45:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/935/pre-commit-hooks/issues/935"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:42ab09f5-2546-1de7-42a3-a6e6a632ce11
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9668:255A34:571698:7639BE:6A554308
html-safe-nonce27b94507f22e0ffb4d8eaf3ab37fc9752b08e594a2e76ecede840cd351dbd633
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjY4OjI1NUEzNDo1NzE2OTg6NzYzOUJFOjZBNTU0MzA4IiwidmlzaXRvcl9pZCI6IjMwMjM5NDExNTQ2NzkxMTI0NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc0e6965c66802b64ef5a51f83dd781d0b63097d130376a929248fb321eb18943
hovercard-subject-tagissue:1813691162
github-keyboard-shortcutsrepository,issues,commits,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit-hooks/935/issue_layout
twitter:imagehttps://opengraph.githubassets.com/587d21ca638c3542771a912b7b0b8cf37324daa86944e234dee781d0e75bcd2a/pre-commit/pre-commit-hooks/issues/935
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/587d21ca638c3542771a912b7b0b8cf37324daa86944e234dee781d0e75bcd2a/pre-commit/pre-commit-hooks/issues/935
og:image:altI am on v.4.4.0, Python 3.11.4, macOS Ventura 13.4.1. My .pre-commit-config.yaml: repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v4.4.0" hooks: - id: end-of-file-fixer - id: fi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepaduszyk
hostnamegithub.com
expected-hostnamegithub.com
Nonecd9eea424140838b22e9eabd53d92b5702617ddd6d76efcd3a37f08d44309ca5
turbo-cache-controlno-preview
go-importgithub.com/pre-commit/pre-commit-hooks git https://github.com/pre-commit/pre-commit-hooks.git
octolytics-dimension-user_id6943086
octolytics-dimension-user_loginpre-commit
octolytics-dimension-repository_id17714713
octolytics-dimension-repository_nwopre-commit/pre-commit-hooks
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17714713
octolytics-dimension-repository_network_root_nwopre-commit/pre-commit-hooks
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3084b9f587e8f1e19803bbe0c77ac77ce3c99c5c
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/pre-commit/pre-commit-hooks/issues/935#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpre-commit%2Fpre-commit-hooks%2Fissues%2F935
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpre-commit%2Fpre-commit-hooks%2Fissues%2F935
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=pre-commit%2Fpre-commit-hooks
Reloadhttps://github.com/pre-commit/pre-commit-hooks/issues/935
Reloadhttps://github.com/pre-commit/pre-commit-hooks/issues/935
Reloadhttps://github.com/pre-commit/pre-commit-hooks/issues/935
Please reload this pagehttps://github.com/pre-commit/pre-commit-hooks/issues/935
pre-commit https://github.com/pre-commit
pre-commit-hookshttps://github.com/pre-commit/pre-commit-hooks
Please reload this pagehttps://github.com/pre-commit/pre-commit-hooks/issues/935
Notifications https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit-hooks
Fork 792 https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit-hooks
Star 6.6k https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit-hooks
Code https://github.com/pre-commit/pre-commit-hooks
Issues 6 https://github.com/pre-commit/pre-commit-hooks/issues
Pull requests 0 https://github.com/pre-commit/pre-commit-hooks/pulls
Actions https://github.com/pre-commit/pre-commit-hooks/actions
Security and quality 0 https://github.com/pre-commit/pre-commit-hooks/security
Insights https://github.com/pre-commit/pre-commit-hooks/pulse
Code https://github.com/pre-commit/pre-commit-hooks
Issues https://github.com/pre-commit/pre-commit-hooks/issues
Pull requests https://github.com/pre-commit/pre-commit-hooks/pulls
Actions https://github.com/pre-commit/pre-commit-hooks/actions
Security and quality https://github.com/pre-commit/pre-commit-hooks/security
Insights https://github.com/pre-commit/pre-commit-hooks/pulse
#944https://github.com/pre-commit/pre-commit-hooks/pull/944
file-contents-sorter adds an extra blank line if the file to be sorted is emptyhttps://github.com/pre-commit/pre-commit-hooks/issues/935#top
#944https://github.com/pre-commit/pre-commit-hooks/pull/944
enhancementhttps://github.com/pre-commit/pre-commit-hooks/issues?q=state%3Aopen%20label%3A%22enhancement%22
good-first-issuehttps://github.com/pre-commit/pre-commit-hooks/issues?q=state%3Aopen%20label%3A%22good-first-issue%22
https://github.com/paduszyk
paduszykhttps://github.com/paduszyk
on Jul 20, 2023https://github.com/pre-commit/pre-commit-hooks/issues/935#issue-1813691162
1https://github.com/pre-commit/pre-commit-hooks/issues/935#user-content-fn-1-d81d198ca5669590ab4688a7dcb54688
https://github.com/pre-commit/pre-commit-hooks/issues/935#user-content-fnref-1-d81d198ca5669590ab4688a7dcb54688
enhancementhttps://github.com/pre-commit/pre-commit-hooks/issues?q=state%3Aopen%20label%3A%22enhancement%22
good-first-issuehttps://github.com/pre-commit/pre-commit-hooks/issues?q=state%3Aopen%20label%3A%22good-first-issue%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.