Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: select all ruff checks and use formatting #87

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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