Skip to content

Commit e2117d8

Browse files
committed
Add Python quality checks to CI workflow
1 parent 87ab3e0 commit e2117d8

File tree

5 files changed

+30
-10
lines changed

5 files changed

+30
-10
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10+
python-quality-checks:
11+
name: Python quality checks
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
- name: Install poetry
18+
run: pipx install poetry==1.8.2
19+
- name: Setup Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.11'
23+
- name: Install dependencies
24+
run: poetry install
25+
- name: Lint
26+
run: poetry run ruff check .
27+
- name: Check formatting
28+
run: poetry run ruff format --check .
29+
- name: Type checking
30+
run: poetry run mypy infrastructure
1031
rust-quality-checks:
1132
name: Rust quality checks
1233
runs-on: ubuntu-latest

infrastructure/app.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python3
22
import aws_cdk as cdk
3-
43
from stack.stack import ServerlessRustStack
54

65
app = cdk.App()

infrastructure/stack/stack.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import pathlib
22

33
from aws_cdk import CfnOutput, Stack
4-
from aws_cdk.aws_lambda import Architecture, Code, Function, Runtime
54
from aws_cdk.aws_cognito import (
6-
UserPool,
7-
StandardAttributes,
8-
StandardAttribute,
95
AuthFlow,
6+
StandardAttribute,
7+
StandardAttributes,
8+
UserPool,
109
UserPoolClient,
1110
)
12-
from aws_cdk.aws_dynamodb import Table, Attribute, AttributeType
11+
from aws_cdk.aws_dynamodb import Attribute, AttributeType, Table
12+
from aws_cdk.aws_lambda import Architecture, Code, Function, Runtime
1313
from constructs import Construct
1414

1515
from stack.api import ServerlessApi

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ exclude = [
4040

4141
[tool.ruff.lint]
4242
select = [
43+
"B", # flake8-bugbear
44+
"C", # flake8-comprehensions
4345
"E", # pycodestyle errors
44-
"W", # pycodestyle warnings
4546
"F", # pyflakes
46-
"C", # flake8-comprehensions
47-
"B", # flake8-bugbear
47+
"I", # imports
4848
"N", # PEP 8 naming convention
49+
"W", # pycodestyle warnings
4950
]
5051

5152
ignore = [

src/settings.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ use serde::Deserialize;
22

33
#[derive(Debug, Deserialize)]
44
pub struct Settings {
5-
#[serde(default)]
65
pub table_name: String,
76
}

0 commit comments

Comments
 (0)