From 58d49b70f08afb2b7c12c1faa63bd7711309d9a7 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Mon, 25 Nov 2019 11:49:18 +0000 Subject: [PATCH] [RFC 0045] Deprecating unquoted URL syntax (#45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * A small RFC on deprecating URL syntax * Convert alternatives to a list * Add a mention of tooling in future work * A remark from @globin about one more problem with unquoted URLs * Grammar edit: comparison of URLs, paths and strings. Co-Authored-By: 7c6f434c <7c6f434c@mail.ru> * Style edit: possibility of future removal Co-Authored-By: 7c6f434c <7c6f434c@mail.ru> * 0045: commit to using the tooling that now exists * Update rfcs/0045-deprecate-url-syntax.md Shepherd team Co-Authored-By: Domen Kožar * Fix shepherd list * Update based on a discussion * Explicitly make future removal conditional on editions; restrict the claim about no special support to the Nix language itself --- rfcs/0045-deprecate-url-syntax.md | 69 +++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 rfcs/0045-deprecate-url-syntax.md diff --git a/rfcs/0045-deprecate-url-syntax.md b/rfcs/0045-deprecate-url-syntax.md new file mode 100644 index 000000000..78d12d411 --- /dev/null +++ b/rfcs/0045-deprecate-url-syntax.md @@ -0,0 +1,69 @@ +--- +feature: deprecate_url_syntax +start-date: 2019-04-28 +author: Michael Raskin +co-authors: +shepherd-leader: Eelco Dolstra +shepherd-team: Eelco Dolstra, zimbatm, Silvan Mosberger +related-issues: +--- + +# Summary +[summary]: #summary + +Discourage and eventually remove the use of unquoted URL syntax in Nix code and especially +Nixpkgs. + +# Motivation +[motivation]: #motivation + +The Nix language has a special syntax for URLs even though quoted strings can also be used to represent them. Unlike paths, URLs do not +have any special properties in the Nix expression language +that would make the difference useful. +Moreover, using +variable expansion in URLs requires some URLs to be quoted strings anyway. So +the most consistent approach is to always use quoted strings to represent URLs. +Additionally, a semicolon immediately after the URL can be mistaken for a part +of URL by language-agnostic tools such as terminal emulators. + +Tools +targeting only Nixpkgs codebase can ignore URL syntax once Nixpkgs phases out +its use. + +# Detailed design +[design]: #detailed-design + +Add a note in the Nix manual that the special unquoted URL syntax is +discouraged and may be removed in a future edition of the Nix language. + +Add a note in the Nixpkgs manual that the unquoted URL syntax should not be used anymore. + +Convert all the unquoted URLs in the Nixpkgs codebase to quoted strings. + +Add an ofBorg check that verifies that no new unquoted URLs have been added in +a PR. + +# Drawbacks +[drawbacks]: #drawbacks + +This is a minor cosmetic issue (and maybe a very minor readability issue) which +might not be worth making a specific decision. + +# Alternatives +[alternatives]: #alternatives + +* Do nothing; get PRs from time to time that make homepages uniformly quoted + strings or uniformly unquoted. + +* Decide to use unquoted URLs for all URLs without special characters or + variable expansion. + +# Unresolved questions +[unresolved]: #unresolved-questions + +Currently none. + +# Future work +[future]: #future-work + +Currently none.