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

Add workflow for performing typing/formatting/linting/ checks on pull requests #23

Merged
merged 2 commits into from
Jun 5, 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
28 changes: 28 additions & 0 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check for typing/linting/formatting errors

on:
pull_request:
types: [opened, synchronize]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
- name: Install dependencies
run: pdm install
- name: Check for formatting errors
run: pdm run format-check
- name: Check for linting errors
run: pdm run lint-check
- name: Check for type errors
run: pdm run check-types

12 changes: 3 additions & 9 deletions src/octologo/styles/underline_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,12 @@
"Iosevka-Nerd-Font-Complete.ttf",
),
SelectQuestion("color", "Select a color scheme", color_scheme_names, "adi1090x"),
TextQuestion(
"underline_count", "Lettrs to undrline", [Number(minimum=0)], "1", "1"
),
TextQuestion("underline_count", "Lettrs to undrline", [Number(minimum=0)], "1", "1"),
TextQuestion("padding_x", "Padding x (px)", [Number()], "200", "200"),
TextQuestion("padding_y", "Padding y (px)", [Number()], "20", "20"),
TextQuestion("gap", "Gap between text and bar (px)", [Number()], "20", "20"),
TextQuestion("bar_size", "Bar weight (px)", [Number()], "20", "20"),
TextQuestion(
"additionnal_bar_width", "Additionnal bar width (px)", [Number()], "20", "20"
),
TextQuestion("additionnal_bar_width", "Additionnal bar width (px)", [Number()], "20", "20"),
]

active = False
Expand Down Expand Up @@ -76,9 +72,7 @@ def get_image(answers: dict) -> ImageClass:
)

# Get the underline position
underline_start_x = first_letters_bbox[0] - int(
answers["additionnal_bar_width"]
)
underline_start_x = first_letters_bbox[0] - int(answers["additionnal_bar_width"])
underline_start_y = first_letters_bbox[3] + int(answers["gap"])

underline_end_x = int(answers["additionnal_bar_width"]) + first_letters_bbox[2]
Expand Down