From 78dc2ea55eb855979171529d72b8f7080903a660 Mon Sep 17 00:00:00 2001 From: Erik Lacson Date: Mon, 14 Jul 2025 16:22:39 +0800 Subject: [PATCH] added linting tool defiition and linting yaml --- .github/workflows/python-lint.yml | 31 +++++++++++++++++++++++++++++++ pyproject.toml | 10 ++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/python-lint.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml new file mode 100644 index 0000000..db3dcd1 --- /dev/null +++ b/.github/workflows/python-lint.yml @@ -0,0 +1,31 @@ +name: Python Lint + +on: + push: + branches: [main] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + + - name: Install tooling + run: pip install black ruff bandit + + - name: Black — code format check + run: black --check . + + - name: Ruff — style & bug lint + run: ruff check . + + - name: Bandit — security scan + run: bandit -r . + + \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..95fbd52 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,10 @@ +[tool.black] +line-length = 100 + +[tool.ruff] +select = ["E", "F", "B"] # style & bug rules +line-length = 100 +ignore = ["E501"] # long lines handled by Black + +[tool.bandit] +skips = ["B101"] # adjust to taste