Skip to content

Commit

Permalink
stylua: 0.14.3 -> 0.15.0 (#192279)
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Sep 22, 2022
1 parent f586d35 commit 2bf91a6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
9 changes: 9 additions & 0 deletions nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,15 @@
option, and it is enabled by default, for servers.
</para>
</listitem>
<listitem>
<para>
<literal>stylua</literal> no longer accepts
<literal>lua52Support</literal> and
<literal>luauSupport</literal> overrides, use
<literal>features</literal> instead, which defaults to
<literal>[ &quot;lua54&quot; &quot;luau&quot; ]</literal>.
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec-release-22.11-notable-changes">
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2211.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).

- `k3s` supports `clusterInit` option, and it is enabled by default, for servers.

- `stylua` no longer accepts `lua52Support` and `luauSupport` overrides, use `features` instead, which defaults to `[ "lua54" "luau" ]`.

<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->

## Other Notable Changes {#sec-release-22.11-notable-changes}
Expand Down
29 changes: 12 additions & 17 deletions pkgs/development/tools/stylua/default.nix
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
{ fetchFromGitHub
, lib
{ lib
, rustPlatform
, lua52Support ? true
, luauSupport ? false
, fetchpatch
, fetchFromGitHub
# lua54 implies lua52/lua53
, features ? [ "lua54" "luau" ]
}:

rustPlatform.buildRustPackage rec {
pname = "stylua";
version = "0.14.3";
version = "0.15.0";

src = fetchFromGitHub {
owner = "johnnymorganz";
repo = pname;
rev = "v${version}";
sha256 = "sha256-l4q6Qlgdxgm4K5+NkWMZI3Hhtx6m/0DG9PE4gvo/ylo=";
sha256 = "sha256-x4/DmFi/6bIQVn8sfSFEOJIv4Zd/3oHKXbrd6yIsSYU=";
};

cargoSha256 = "sha256-zlk9KdiSKWknyuJTTqpzCeSJUXJGDK2A0g1ss8AHoYs=";
cargoSha256 = "sha256-lY18so+uG3yri18zd29B479nl0l1C0F1mw+sPrccRQs=";

cargoPatches = [
# fixes broken 0.14.3 lockfile
(fetchpatch {
url = "https://github.com/JohnnyMorganz/StyLua/commit/834f632f67af6425e7773eaade8d23a880946843.patch";
sha256 = "sha256-oM2gaILwiNMqTGFRQBw6/fxbjljNWxeIb0lcXcAJR3w=";
})
];
# remove cargo config so it can find the linker on aarch64-unknown-linux-gnu
postPatch = ''
rm .cargo/config.toml
'';

buildFeatures = lib.optional lua52Support "lua52"
++ lib.optional luauSupport "luau";
buildFeatures = features;

meta = with lib; {
description = "An opinionated Lua code formatter";
Expand Down

0 comments on commit 2bf91a6

Please sign in to comment.