Disallow executable bit on .nix files without shebang (NPV-145)#199
Open
philiptaron wants to merge 2 commits intoNixOS:mainfrom
Open
Disallow executable bit on .nix files without shebang (NPV-145)#199philiptaron wants to merge 2 commits intoNixOS:mainfrom
philiptaron wants to merge 2 commits intoNixOS:mainfrom
Conversation
13 tasks
Member
mdaniels5757
left a comment
There was a problem hiding this comment.
Mostly looks good to me.
Ideally I think there would be another test case or 2 covering the "+x with shebang" and/or "-x with shebang" cases. (We have no shortage of the "-x without shebang" case, of course :) )
Address PR feedback: check executable iff shebang, not just executable-implies-shebang. Rename check_not_executable to check_executable_iff_shebang. Add test cases for +x/+shebang (pass) and -x/+shebang (fail).
13 tasks
Contributor
Author
|
I've added NPV-146 and an accompanying nixpkgs PR for it |
mdaniels5757
approved these changes
Feb 18, 2026
Member
mdaniels5757
left a comment
There was a problem hiding this comment.
Looks good to me, but this will need #491208 and #491190 to make it to the nixpkgs-unstable channel, then the automated update workflow to be run, then a rebase.
Contributor
Author
|
Yes, absolutely. It's on ice until then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.nixfiles with the executable bit set that lack a shebang (#!) line.nixfiles in nixpkgsCloses #110
Test plan
nix-file-executablewith an executablepackage.nix(no shebang) verifies the error is reportedcargo fmt -- --checkpasses