Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 13, 2024
1 parent 8d9f23c commit 182e95a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
python -Im pip install --upgrade tox
- name: Run tox targets for ${{ matrix.python-version }}
run: python -Im tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)

- name: Run mypy
run: python -Im tox run -e mypy
if: matrix.python-version == '3.11'
Expand Down
8 changes: 6 additions & 2 deletions src/interrogate/badge_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
# depending on the character length of the result (e.g. 100, 99.9, 9.9)
# a few values in the svg template need to adjust so it's readable.
# Tuple of values: (svg_width, rect_width, text_x, text_length)
SVG_WIDTH_VALUES: dict[str, dict[str, tuple[int, int, NumberType, NumberType]]] = {
SVG_WIDTH_VALUES: dict[
str, dict[str, tuple[int, int, NumberType, NumberType]]
] = {
# integer
"100": {
"plastic": (135, 43, 1140, 330),
Expand Down Expand Up @@ -123,7 +125,9 @@ def save_badge(
return output


def _get_badge_measurements(result: float, style: str) -> dict[str, NumberType]:
def _get_badge_measurements(
result: float, style: str
) -> dict[str, NumberType]:
"""Lookup templated style values based on result number."""
if result == 100:
width_values = SVG_WIDTH_VALUES["100"]
Expand Down

0 comments on commit 182e95a

Please sign in to comment.