Skip to content

Commit 1b3294c

Browse files
committed
feat: ruff linting and codeberg syncing
1 parent 9c00d50 commit 1b3294c

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.github/workflows/codeberg.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# taken from: https://github.com/Vendicated/Vencord/blob/main/.github/workflows/codeberg-mirror.yml
2+
3+
name: Sync to Codeberg
4+
concurrency:
5+
group: ${{ github.ref }}
6+
cancel-in-progress: true
7+
on:
8+
push:
9+
workflow_dispatch:
10+
schedule:
11+
- cron: "0 */6 * * *"
12+
13+
jobs:
14+
codeberg:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: pixta-dev/repository-mirroring-action@674e65a7d483ca28dafaacba0d07351bdcc8bd75 # v1.1.1
21+
with:
22+
target_repo_url: "[email protected]:${{github.repository}}.git"
23+
ssh_private_key: ${{ secrets.CODEBERG_SSH_PRIVATE_KEY }}

.github/workflows/ruff.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Ruff linting
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install .[dev]
24+
25+
- name: Lint with ruff
26+
run: |
27+
# stop the build if there are Python syntax errors or undefined names
28+
ruff check --target-version=py38 .

ruff.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
2+
# lint.select = ["E", "F"]
3+
lint.ignore = ["E501", "E402", "E702", "E701", "E731", "F405", "F403"]
4+
5+
target-version = "py38"

0 commit comments

Comments
 (0)