flake: fix string escapes - #361
Open
antonmosich wants to merge 1 commit into
Open
Conversation
Contributor
|
Would be cool if this could be merged! |
|
Lix 2.95 has been released so more users are seeing this. Just an FYI. |
|
@antonmosich could you please rebase this PR? I'd like to use it as my flake input. |
In nixlang "\." is escaped to just ".". That is, it does nothing. For there to be a "\." in the resulting string, two backslashes are needed. Lix on main now emits a warning in such cases. See the example nix repl output: nix-repl> :p "Cargo\.lock" Cargo.lock nix-repl> :p "Cargo\\.lock" Cargo\.lock PR serokell#394 removed four `\.` in regular expressions in flake.nix and replaced them with `.`. While this is a non-breaking change in the sense that it did not change the regular expressions, this is not the correct change. `.` is a wildcard character in regular expressions so if you want to match a `.` you _do_ need the \, which needs to appear twice in the nix code to be escaped properly.
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.
In nixlang "\." is escaped to just ".". That is, it does nothing. For there to be a "\." in the resulting string, two backslashes are needed. Lix on main now emits a warning in such cases. See the example nix repl output: