Skip to content

Commit

Permalink
hm
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelacey committed Jan 23, 2023
1 parent 6f425d6 commit 216f709
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- run: pip install pipenv
- run: pipenv run install_linters
- run: pipenv run check
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ pytest-xdist = {extras = ["psutil"], version = "*"}
twine = "*"

[scripts]
install_linters = "pipenv install black flake8 flake8-bandit flake8-bugbear flake8-docstrings flake8-pyproject flake8-quotes isort --dev --skip-lock"
check = "./script/check"
lint = "./script/lint"
4 changes: 4 additions & 0 deletions script/check
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cd "$(dirname "$0")/.."

ARROW="\033[93m==>\033[0m"

if [ ${CI:+x} ]; then
cat Pipfile | grep "^black\|^flake8\|^isort" | sed "s/ = .*//g" | xargs pipenv install --dev --skip-lock
fi

echo -e "$ARROW black worf tests --check"
black worf tests --check

Expand Down
4 changes: 4 additions & 0 deletions script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cd "$(dirname "$0")/.."

ARROW="\033[93m==>\033[0m"

if [ ${CI:+x} ]; then
cat Pipfile | grep "^black\|^flake8\|^isort" | sed "s/ = .*//g" | xargs pipenv install --dev --skip-lock
fi

echo -e "$ARROW autoflake --in-place --recursive --remove-all-unused-imports worf tests"
autoflake --in-place --recursive --remove-all-unused-imports worf tests

Expand Down
2 changes: 1 addition & 1 deletion tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_avatar_url(self):
return self.avatar.url if self.avatar else self.get_gravatar_url()

def get_gravatar_hash(self):
return md5(self.user.email.lower().encode(), usedforsecurity=False).hexdigest()
return md5(self.user.email.lower().encode()).hexdigest() # noqa: S324

def get_gravatar_url(self, default="identicon", size=512):
return f"https://www.gravatar.com/avatar/{self.get_gravatar_hash()}?d={default}&s={size}"
Expand Down

0 comments on commit 216f709

Please sign in to comment.