Skip to content

Commit

Permalink
Merge branch 'main' into pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
  • Loading branch information
schtobia authored Apr 6, 2024
2 parents 44f79b9 + df94ae1 commit 8ac86c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ env:

jobs:
test:
name: Test - ${{ matrix.python-version }}
name: Test - Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} & PDM
uses: pdm-project/setup-pdm@v3
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
cache: true
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Validate links in Markdown files
uses: JustinBeckwith/linkinator-action@v1
Expand All @@ -43,7 +43,7 @@ jobs:
linksToSkip: "https://pypi.org/project/pelican-featured-image/"

- name: Set up Python & PDM
uses: pdm-project/setup-pdm@v3
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
cache: true
Expand All @@ -67,12 +67,12 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ markdown = ["markdown>=3.4"]

[tool.pdm.dev-dependencies]
lint = [
"black>=23.10.1",
"invoke>=2.2.0",
"ruff>=0.1.3",
"ruff>=0.3.5,<0.4.0"
]
test = [
"markdown>=3.4",
Expand All @@ -57,7 +56,7 @@ git-username = "botpub"
git-email = "[email protected]"
append-github-contributor = true

[tool.ruff]
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
Expand Down Expand Up @@ -92,7 +91,7 @@ ignore = [
"RUF100", # unused blanket `NOQA` directive
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true
force-sort-within-sections = true
known-first-party = ["pelican"]
Expand Down
12 changes: 0 additions & 12 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,6 @@ def tests(c, deprecations=False):
c.run(f"{CMD_PREFIX}pytest {deprecations_flag}", pty=PTY)


@task
def black(c, check=False, diff=False):
"""Run Black auto-formatter, optionally with `--check` or `--diff`."""
check_flag, diff_flag = "", ""
if check:
check_flag = "--check"
if diff:
diff_flag = "--diff"
c.run(f"{CMD_PREFIX}black {check_flag} {diff_flag} {PKG_PATH} tasks.py", pty=PTY)


@task
def ruff(c, fix=False, diff=False):
"""Run Ruff to ensure code meets project standards."""
Expand All @@ -58,7 +47,6 @@ def ruff(c, fix=False, diff=False):
def lint(c, fix=False, diff=False):
"""Check code style via linting tools."""
ruff(c, fix=fix, diff=diff)
black(c, check=(not fix), diff=diff)


@task
Expand Down

0 comments on commit 8ac86c5

Please sign in to comment.