Skip to content

Commit 9443b63

Browse files
committed
treewide: fix outstanding lint issues
1 parent 5578d42 commit 9443b63

File tree

4 files changed

+20
-21
lines changed

4 files changed

+20
-21
lines changed

.github/workflows/grapheneos-update.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
# buildNumber is the only quoted string inside upstream-params.nix so we can
1818
# just use grep to extract the first quoted string and use xargs to strip the
1919
# quotes
20-
OLD_BUILD_NUMBER=$(grep -o -m 1 '"[^"]*"' ./flavors/grapheneos/upstream-params.nix | xargs)
21-
echo "OLD_BUILD_NUMBER=$OLD_BUILD_NUMBER" | tee -a $GITHUB_ENV
20+
OLD_BUILD_NUMBER="$(grep -o -m 1 '"[^"]*"' ./flavors/grapheneos/upstream-params.nix | xargs)"
21+
echo "OLD_BUILD_NUMBER=$OLD_BUILD_NUMBER" | tee -a "$GITHUB_ENV"
2222
2323
nix develop -c ./flavors/grapheneos/extract-upstream-params.sh
2424
25-
NEW_BUILD_NUMBER=$(grep -o -m 1 '"[^"]*"' ./flavors/grapheneos/upstream-params.nix | xargs)
26-
echo "NEW_BUILD_NUMBER=$NEW_BUILD_NUMBER" | tee -a $GITHUB_ENV
25+
NEW_BUILD_NUMBER="$(grep -o -m 1 '"[^"]*"' ./flavors/grapheneos/upstream-params.nix | xargs)"
26+
echo "NEW_BUILD_NUMBER=$NEW_BUILD_NUMBER" | tee -a "$GITHUB_ENV"
2727
- name: "Update devices"
2828
if: env.OLD_BUILD_NUMBER != env.NEW_BUILD_NUMBER
2929
run: |
3030
for DEVICE in crosshatch sunfish oriole; do
31-
METADATA=$(curl -sSfL "https://releases.grapheneos.org/$DEVICE-beta")
32-
BUILD_PREFIX=$(echo "$METADATA" | cut -d" " -f3)
31+
METADATA="(curl -sSfL "https://releases.grapheneos.org/$DEVICE-beta")"
32+
BUILD_PREFIX="$(echo "$METADATA" | cut -d" " -f3)"
3333
git mv "./flavors/grapheneos/repo-$BUILD_PREFIX.$OLD_BUILD_NUMBER.json" \
3434
"./flavors/grapheneos/repo-$BUILD_PREFIX.$NEW_BUILD_NUMBER.json"
3535
nix develop -c ./flavors/grapheneos/update.sh "$BUILD_PREFIX.$NEW_BUILD_NUMBER"

.github/workflows/instantiate.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ jobs:
1515
extra_nix_config: |
1616
experimental-features = nix-command flakes
1717
- run: |
18-
nix run github:nix-community/nix-eval-jobs/3f305f4538e056e6f6f775e1f75410b6d4d8d9aa -- --workers $(nproc) --option allow-import-from-derivation false --show-trace ./release.nix | tee eval.json
18+
nix run github:nix-community/nix-eval-jobs/3f305f4538e056e6f6f775e1f75410b6d4d8d9aa -- --workers "$(nproc)" --option allow-import-from-derivation false --show-trace ./release.nix | tee eval.json
1919
jq -c 'select(.error)' eval.json | tee errors.json
20-
if [[ "$(wc -l < errors.json)" > 0 ]]; then exit 1; fi
20+
if [[ "$(wc -l < errors.json)" -gt 0 ]]; then exit 1; fi
2121
robotnix-eval-tests:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/[email protected]
2525
- uses: cachix/install-nix-action@v12
2626
- run: |
27-
OUTPUT=$(nix-instantiate --eval --strict tests/eval.nix)
27+
OUTPUT="$(nix-instantiate --eval --strict tests/eval.nix)"
2828
if [[ "$OUTPUT" != "[ ]" ]]; then
2929
echo "Instantiation tests failed:"
30-
echo $OUTPUT
30+
echo "$OUTPUT"
3131
fi
3232
nixos-tests:
3333
runs-on: ubuntu-latest
@@ -55,10 +55,10 @@ jobs:
5555
experimental-features = nix-command flakes
5656
- run: |
5757
nix flake check
58-
export ORIG_DIR=$PWD
59-
cd $(mktemp -d)
60-
nix flake init -t $ORIG_DIR
61-
nix flake check --override-input robotnix $ORIG_DIR
58+
export ORIG_DIR="$PWD"
59+
cd "$(mktemp -d)"
60+
nix flake init -t "$ORIG_DIR"
61+
nix flake check --override-input robotnix "$ORIG_DIR"
6262
checks:
6363
runs-on: ubuntu-latest
6464
steps:

flavors/lineageos/update_device_metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from typing import Any
66
import json
7-
import urllib.request
87
import os
98
import pathlib
109

scripts/robotnix_common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ def save(filename: str, data: Any) -> None:
3333
)
3434

3535

36-
def get_store_path(path):
36+
def get_store_path(path_str: str) -> str:
3737
"""Get actual path to a Nix store path; supports handling local remotes"""
38-
prefix = os.getenv("NIX_REMOTE")
38+
prefix_str = os.getenv("NIX_REMOTE")
3939

40-
if not prefix:
41-
return path
40+
if not prefix_str:
41+
return path_str
4242

43-
prefix = Path(prefix)
43+
prefix = Path(prefix_str)
4444

4545
if not prefix.is_absolute():
4646
raise Exception(
4747
f"Must be run on a local Nix store. Current Nix store: {prefix}"
4848
)
4949

50-
path = Path(path).resolve()
50+
path = Path(path_str).resolve()
5151
remote_path = prefix.resolve().joinpath(
5252
path.relative_to(f"{path.drive}{path.root}")
5353
)

0 commit comments

Comments
 (0)