From ae7c1f0fb4faf8c7a435d7537567b67e4932baf2 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Thu, 10 Oct 2024 13:03:51 +1300 Subject: [PATCH] pre-commit: Format using nixfmt-rfc-style --- pkgs/by-name/pr/pre-commit/package.nix | 61 ++++++++++++++------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/pr/pre-commit/package.nix b/pkgs/by-name/pr/pre-commit/package.nix index d11b373aada0..517f6fc3ef85 100644 --- a/pkgs/by-name/pr/pre-commit/package.nix +++ b/pkgs/by-name/pr/pre-commit/package.nix @@ -1,18 +1,19 @@ -{ lib -, fetchFromGitHub -, python3Packages -, libiconv -, cargo -, coursier -, dotnet-sdk -, git -, glibcLocales -, go -, nodejs -, perl -, cabal-install -, testers -, pre-commit +{ + lib, + fetchFromGitHub, + python3Packages, + libiconv, + cargo, + coursier, + dotnet-sdk, + git, + glibcLocales, + go, + nodejs, + perl, + cabal-install, + testers, + pre-commit, }: with python3Packages; @@ -81,24 +82,26 @@ buildPythonApplication rec { "--forked" ]; - preCheck = lib.optionalString (!(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64)) '' - # Disable outline atomics for rust tests on aarch64-linux. - export RUSTFLAGS="-Ctarget-feature=-outline-atomics" - '' + '' - export GIT_AUTHOR_NAME=test GIT_COMMITTER_NAME=test \ - GIT_AUTHOR_EMAIL=test@example.com GIT_COMMITTER_EMAIL=test@example.com \ - VIRTUALENV_NO_DOWNLOAD=1 PRE_COMMIT_NO_CONCURRENCY=1 LANG=en_US.UTF-8 + preCheck = + lib.optionalString (!(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64)) '' + # Disable outline atomics for rust tests on aarch64-linux. + export RUSTFLAGS="-Ctarget-feature=-outline-atomics" + '' + + '' + export GIT_AUTHOR_NAME=test GIT_COMMITTER_NAME=test \ + GIT_AUTHOR_EMAIL=test@example.com GIT_COMMITTER_EMAIL=test@example.com \ + VIRTUALENV_NO_DOWNLOAD=1 PRE_COMMIT_NO_CONCURRENCY=1 LANG=en_US.UTF-8 - # Resolve `.NET location: Not found` errors for dotnet tests - export DOTNET_ROOT="${dotnet-sdk.unwrapped}/share/dotnet" + # Resolve `.NET location: Not found` errors for dotnet tests + export DOTNET_ROOT="${dotnet-sdk.unwrapped}/share/dotnet" - export HOME=$(mktemp -d) + export HOME=$(mktemp -d) - git init -b master + git init -b master - python -m venv --system-site-packages venv - source "$PWD/venv/bin/activate" - ''; + python -m venv --system-site-packages venv + source "$PWD/venv/bin/activate" + ''; postCheck = '' deactivate