Skip to content

Commit

Permalink
Updated sort script to work with python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
spirillen committed Sep 5, 2024
1 parent 3ba567b commit e389f17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@main

- name: Setup Python 3.11
- name: Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12

- name: Install requirements
run: |
Expand Down
8 changes: 3 additions & 5 deletions tools/hierarchical_sort.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#!/usr/bin/env bash

## This script should be placed in pre-commit-hooks
set -xe
set -e
GIT_DIR="$(git rev-parse --show-toplevel)"

if [ -d "$GIT_DIR" ]; then
cd "${GIT_DIR}" || exit 1


FILES=('add-domain' 'add-wildcard-domain' 'falsepositive.list' 'falsepositive_regex.list' 'falsepositive_rzd.list')
FILES=('add-domain' 'add-wildcard-domain' 'falsepositive.list' 'falsepositive_regex.list' 'falsepositive_rzd.list')

for i in "${FILES[@]}"; do
python3.11 "$GIT_DIR/tools/domain-sort.py" <"${i}" >"${i}.tmp" &&
python3 "$GIT_DIR/tools/domain-sort.py" <"${i}" >"${i}.tmp" &&
sed "/^$/d" "${i}.tmp" >"${i}" && rm "${i}.tmp"
done
fi

0 comments on commit e389f17

Please sign in to comment.