Skip to content

Commit

Permalink
chore: select all ruff checks and use formatting (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare committed Apr 27, 2024
1 parent fd16f2b commit eed3585
Show file tree
Hide file tree
Showing 6 changed files with 308 additions and 486 deletions.
24 changes: 6 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.4.2'
hooks:
- id: pyupgrade
args:
- --py39-plus
- repo: local
hooks:
- id: black
name: black
language: system
entry: black
types: [python]
- id: isort
name: isort
language: system
entry: isort
types: [python]
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: 'v4.5.0'
hooks:
- id: trailing-whitespace
exclude: ^src/api/client.js$
Expand Down
5 changes: 3 additions & 2 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import mkdocs_gen_files

readme = Path("README.md").open("r")
with mkdocs_gen_files.open("index.md", "w") as index_file:
with Path("README.md").open("r") as readme, mkdocs_gen_files.open(
"index.md", "w"
) as index_file:
index_file.writelines(readme.read())
12 changes: 4 additions & 8 deletions font_fjallaone/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
"""Fjalla One from from Sorkin Type as distributed by Google Fonts."""

import glob
import os
from pathlib import Path

font_directory = os.path.join(os.path.abspath(os.path.dirname(__file__)), "files")
font_directory = Path(__file__).parent.resolve() / "files"

font_files = {}

for font in list(glob.glob(os.path.join(font_directory, "*.ttf"))):
for font in list(font_directory.glob("*.ttf")):
font_name = (
os.path.basename(font)
.replace(".ttf", "")
.replace("-Regular", "")
.replace("-", "")
Path(font).name.replace(".ttf", "").replace("-Regular", "").replace("-", "")
)
font_files[font_name] = font
globals()[font_name] = font
Loading

0 comments on commit eed3585

Please sign in to comment.